SSO - Architecture - Working mechanisms

What is SSO?

SSO means Single Sign On.

Why SSO?

Using SSO is a method of sharing user sessions with multiple domains. For example:,, & Use case: 1. User will land on any 1 site 2. User will login using login credentials 3. User will be authenticated in 4. User visits app[1/2].com 5. User should be logged in without asking for user credentials.

The above scenario can be achieved using SSO. Using SSO, user will be sharing session between associated sites.

Any Examples?

Google: After user logging-in, visiting will make the user already logged in.

How it differs from oAuth?

With OAuth, you can authenticate a user at an external server and get access to their profile info. However you aren't sharing a session.

A user logs in to website using Google OAuth. Next he visits website which also uses Google OAuth. Regardless of that, he is still required to press on the 'login' button on

With Jasny/SSO both websites use the same session. So when the user visits, he's automatically logged in. When he logs out (on either of the sites), he's logged out for both.

Workflow? - Need more clarity From my learning An auth service @9000 3 App servers 9001 - 9003 Auth server details added as environment variables in App servers. app server attaches its session in Auth server with expiration time When user fills login form and submits, user credentials will be validated a cURL request sent to auth server to verify credentials valid credentials will generate a cookie in client on each request cookie will be sent to server for session validation

Simple way of implementing it? -

Try this

Any Reference?


Isolation Individual server scalability Micro services architecture Session sharing between register app server seamless session maintenance Debugging Optimization Refactoring Each apps no need to aware of others existence. such as no need to aware of, this provides isolation of services very effective way.

for example, no need to aware of existence, or chat application. Authentication service alone will know about existence of other applications which is required other service. So the services are fully independently functional.

Here event driven architecture also can be implemented. once user logged in, auth service can publish an event and whoever/whichever subscribing login event, can let the user without requesting login again.

This will help let individual team to develop separate services, without knowing others existence. Maintenance will be easy for individual apps


Over load on auth server Need high availability servers session maintenances over proxies Might be facing issues in LoadBalancers

Additional Information: Each http request from client will send cookies to server. That is the default behaviour. Using cookie free server for static content is best way for structuring content delivery.