CAS cluster Solution

Source: Internet
Author: User

The purpose of this solution is to build a highly available and scalable center authentication service. The environment is CAS servers that can be expanded at will, and any CAS service node is equivalent. The status information of CAS servers is centrally stored. The client applications of CAS services are also cluster environments, the client application server can be expanded at will. The session status information of the client application is stored centrally, and any two application service nodes are equivalent; the status information of CAS servers and client applications is stored on the Cache Server memcached. This solution has the following features.

L only tomcat6.x and tomcat7.x are supported.

L no spof.

L ability to cope with Tomcat failover.

L ability to handle memcached failover.


Note: One problem in the above solution is that if the CAS server application or client application directly stores some State data in the JVM local object, the node will be not equivalent, even an unstable fault occurs. The solution to this problem is: 1. Avoid this situation. 2. Synchronize all objects between JVM instances.

1.1. Normal login process (non-single sign-on)


 

It is discussed that the user's browser has no TGT cookie value, that is, he has never logged on to the CAS server.

1. the user's browser accesses the resources that must be connected to the network. If the user does not log on to the applications that must be connected to the network, the session state of each node of the network must be stored centrally, so any node is equivalent.

2. the user's browser is forwarded to the CAS server. The service parameter is included, that is, the URL address of the required network.

3. The/login address that the user accesses the CAS service. The user's cookie does not contain the TGT value. The CAS server generates LT and returns the logon page to the user's browser.

4. Enter the correct user name and password on the logon page and submit the password to the CAS server.

5. The CAS server receives the user's creden. After verification, if it is correct, TGT is generated and stored in the ticket repository. Because the service parameter value is included, CAS generates the st value for the service. Then return to the user's browser, write the TGT value to the cookie of the user's browser, and redirect the URL value specified by the Service parameter value for the browser, with the parameter ticket = sT value.

6. the user must access the protected network resources again. The parameter value is ticket = ST. After the filter in the mandatory network application detects this parameter, it sends the value of service and ticket to the cas url/servicevalidate. This address will verify St. After verification, a verification result is returned to the client application. If the verification result is correct, the logon user name is returned. The client application performs post-Logon processing for the user in the application, such as loading user information and permissions, and placing them in the session. Now the logon is complete.

7. Consider accessing different servers. For example, if a user accesses application Node 1 for the first time and connection node 2 for the second access, the two nodes are equivalent because session information is shared. If you access CAS Node 1 for the first time and CAS Node 2 for the second time, since session and ticket information are shared and stored in centralized storage, access to any node is equivalent, A ticket can be effectively authenticated on any node.

Conclusion: There is no problem with the process cluster.

1.2. Single Sign-On Process


 

When the user's browser has a valid TGT, that is, the user's browser has logged on to the CAS server. In this case, the user accesses the required network again, and the user does not log on to the required network application.

1. When a user accesses a protected resource of the connected network, the session Status of each node of the connected network is stored in a centralized manner, and any node is equivalent. If a user does not log on to a required Internet application, the request is intercepted and forwarded to the CAS server. The service parameter is included, that is, the URL of the required Internet is included.

2. The/login address that the user accesses the CAS service. Because you have logged on to the CAS server, the user's cookie contains the TGT value, and The TGT value is verified. If it is correct, because the service parameter value is included, CAS also generates the st value for the service. Return to the user's browser, and redirect the URL value specified by the Service parameter value to the browser, with the ticket = sT parameter value.

3. the user must access the protected network resources again. The parameter value is ticket = ST. After the filter in the mandatory network application detects this parameter, it sends the value of service and ticket to the cas url/servicevalidate. This address will verify St. After verification, a verification result is returned to the client application. If the verification result is correct, the logon user name is returned. The client application performs post-Logon processing for the user in the application, such as loading user information and permissions, and placing them in the session. Now the logon is complete.

4. Consider accessing different servers. For example, if a user accesses application Node 1 for the first time and connection node 2 for the second access, the two nodes are equivalent because session information is shared. If you access CAS Node 1 for the first time and CAS Node 2 for the second time, since session and ticket information are shared and stored in centralized storage, access to any node is equivalent, A ticket can be effectively authenticated on any node.

Conclusion: There is no problem with the process cluster.

1.3. Unified logout process


 

Assume that user a has logged on to CAS Server Node 1 in a unified manner, and must join Network Node 2 and bidding Network Node 1. In this case, the user wants to log out of all systems in a unified manner. Follow these steps.

1. User A accesses the logout path/logout of CAS Server Node 2 through a browser. Since the CAS server is configured to centrally store sessions and tickets, you can identify the user's information. First, destroy the session information of the user's corresponding TGT and CAS server. Then exit all logged-on services cyclically.

2. log out of the mandatory network service that user a logs on. If the CAS service calls the logout address of connection node 1, the node can correctly exit the user and destroy the user's session and other logon information due to session sharing.

3. Withdraw from the bidding network service logged on to user. If the CAS service calls the logout address of the bidding Network Node 2, the node can correctly exit the user and destroy the user's session and other login information due to session sharing.

Conclusion: There is no problem with the process cluster.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.