How would you implement SSO for Microservice Architecture?

Technology CommunityCategory: MicroservicesHow would you implement SSO for Microservice Architecture?
VietMX Staff asked 3 years ago

Add identity service and authorize service access through it using tokens. Any service that has protected resources will talk to the Identity service to make sure the credentials (token) it has are valid. If they are not it will redirect the user for authentication. Once the token had been validated then it could be saved in the session so subsequent calls in the user’s session did not have to make the additional call. You can also create a scheduled job if tokens need to be refreshed in that session.

A good way to resolve it is by using the OAuth 2 protocol. In this situation you could authenticate with an OAuth 2.0 endpoint and the token will be added to the HTTP header for calls to your domain. All of the services shall be routed from that domain so you could get the token from the HTTP header.