Hey there, we see you aren't signed in.
Please consider creating an account on dev.to. It literally takes a few seconds and we'd appreciate the support so much. ❤️
I don't know if it's the best way because it depends on requirements, constraints and such but I would take a look at using an API Gateway as the auth layer.
The user requests an API, the gateway authenticates the requests, generates a token and opens the gates or blocks the request.
The type of auth flow depends a lot on what you want to accomplish but tools like Kong support different type of authentication methods (from basic auth to jwt to oauth2 to openid to others)
See also How can I add authentication to a microservice/API?
Another way might be to use an external authentication service, like Okta or Auth0
So I'm trying to remedy my carpal tunnel by considering making the decision to ...
We’re a place for programmers to stay up-to-date, learn new skills, and share ideas.
We’ll never post without your permission.