What is the best way to authenticate users in microservices?

Did you find this post useful? Show some love!

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

Classic DEV Post from Apr 26

Can you explain to me what's going on in this code?

In trying to understand a Google snippet I had the thought that it might be an ...

READ POST
Follow @ben to see more of their posts in your feed.
Saeed Moqadam
Member since Jan 29, 2018
Trending on dev.to
What's in your bookmarks bar?
#tools #productivity #discuss
Note taking as a developer
#discuss #notes
They Watched Us With Webcams And Rewrote Our Code!
#career #culture #databases #story
What are good ways to learn software architecture and systems design?
#advice #discuss #architecture #reading
Why do people like Ruby?
#discuss #ruby
Why I love hiring Junior engineers
#engineers #culture #career
How to Be Really Awesome at Your Job and Not Be A Complete Jerk
#interpersonalskills #leadership #career
Code camp or self-learning
#discuss #productivity