What is the process for implementing single sign-on in shiro?
The process of Shiro implementing single sign-on is as follows:
- When a user accesses system A, the system will check for the presence of the user’s Cookie or Session. If it is not found, the user will be redirected to the Central Authentication Service (CAS) for login.
- After receiving a login request from System A, the Central Authentication Service (CAS) asks the user to enter their username and password for authentication.
- After successful authentication by the Central Authentication Service (CAS), a ticket is generated and stored on the CAS server.
- The Central Authentication Service (CAS) will return the ticket to System A.
- System A sends the ticket to the user’s browser and saves it in a Cookie.
- When users visit system B, the system checks for the presence of the user’s Cookie or Session. If it is not found, the user will be redirected to the Central Authentication Service (CAS) for verification.
- Upon receiving a validation request from system B, the Central Authentication Service (CAS) checks if the ticket is valid.
- Once the Central Authentication Service (CAS) has verified the user’s identity, it will return the user’s information to System B and generate a ticket for System B.
- System B sends the ticket to the user’s browser and saves it in the Cookie.
- Users access other systems C and system D, repeating steps 6-9 to achieve single sign-on.
After going through the mentioned process, users only need to log in once and can access different systems without having to enter their username and password every time. The Central Authentication Service (CAS) is responsible for authentication and authorization, and individual systems just need to communicate with the CAS.