Single sign-on (SSO) is conceptually pretty simple.
- User hits
domain1.com. domain1.comsees there’s no session cookie.domain1.comredirects tosso.comsso.compresents login page, and take credentialssso.comsets session cookie for the usersso.comthen redirects back todomain1to a special url (likedomain1.com/ssologin)- the
ssologinURL contains a parameter that is basically “signed” by thesso.com. It could be as simple as a base64 of encrypting the loginid using a shared secret key. domain1.comtakes the encrypted token, decrypts it, uses the new login id to log in the user.domain1sets the session cookie for the user.
Now, the next case.
- User hits
domain2.com, which followsdomain1and redirects tosso.com sso.comalready has a cookie for the user, so does not present the login pagesso.comredirects back todomain2.comwith the encrypted informationdomain2.comlogs in the user.
That’s the fundamentals of how this works. You can make it more robust, more feature rich (for example, this is SSOn, but not SSOff, user can “log out” of domain1, but still be logged in to domain2). You can use public keys for signing credentials, you can have requests to transfer more information (like authorization rights, etc) from the SSO server. You can have more intimate integration, such as the domains routinely checking that the user still has rights from the SSO server.
But the cookie handshake via the browser using redirects is the key foundation upon which all of these SSO solutions are based.