I think you donβt understand how single sign-on works.
Let's look at website1 and site2 that want to use one single.
A website with an identifier is created. This is the only place the login screen appears.
When a user visits website1 and selects a login, site1 sends the user to the identityProvider login screen. The user logs on to identityProvider, which drops its own cookie for its domain (and possibly allows the user to save their authentication information so that they are no longer requested). Then it redirects the browser back to website1, including the token in the request that opens on website1, receives the identification information and executes its own login bits (discarding its own cookie authenticator, which continues, although it wants to).
Then the user visits site2 and selects the login. Website2 bounces from the user to the Provider identifier, which already knows who the user is, and if the user decides to save his registration information, silently authenticates and then redirects back to website2 with another token that opens on site2, and then executes its own bits entrance.
There is a bunch of security there, restricting tokens to specific websites, only allowing tokens to be sent to white sites, etc. etc.
So, to solve your problems
- The user logs on to website1, and then goes to website2. How will site2 know that the user is logged in? This is not true. website2 must first request authentication information from the single site.
- Does this mean that I need to sort all the URLs on website1 which is occupied by website2? Not unless you make website1 an identity provider too. Even then it would hurt, it is better to have the website 2 redirected back to the identifier if a token is required.
- Secondly, if the user continues to browse website2, say 1 hour, then go to website1. By that time, the session with the website1 has expired, so the user will see the login page, right? - It depends on how you set up the website1 and how long it has been supporting the authentication cookie.
- But this behavior is incorrect due to a single feature of functionality. No no. Single signon does not mean that you get a floating token that is shared between sites. Each website that uses single sign-on still creates its own authentication cookie. What can happen if a user returns to site1, he finds an expired cookie for authentication, and then sends the user back to the single sign-on page, where they authenticate (silently), and a new token returns to site1, which creates a new authentication cookie for himself .
blowdart
source share