Single sign-on

If you are implementing a big enterprise solution that consists of different distributed applications that require authentication and authorization but require to use the same user's database, you will need to implement a different flow to manage the authentication in all these independent applications. This mechanism is called single sign-on (SSO), which will basically ask for login once in any of your applications and will reuse the same generated token in all the applications. The following diagram explains this flow:

In the preceding illustration, there are three applications. Let's suppose that these three different applications are developed by the same company and the employees use the three applications. Imagine that in order to access each application, the employees have to log in to each application using different credentials, or they can choose to use the same username and password for the three apps.

Why should our users log in again to another application if these applications share the same user information? First, a user will log in to the server and retrieve a valid token. Once the first application is logged in to, it can save the token as cookies or in LocalStorage in the browser. When the user accesses Application 02, the app should detect that there is an existing token and should use it to access the server without asking for credentials.

Now that you know how SSO works, You are free to implement SSO by yourself or use an external service. Auth0 has an awesome support for SSO.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset