Hugeo's CAS series: https://blog.csdn.net/u010588262/article/category/7548325
Demo Download: https://download.csdn.net/download/u010588262/10327539 Configuration Host
Download the official demo to retrofit
Https://github.com/cas-projects/cas-sample-java-webapp project Configuration
Official Demo Import Idea
Modify Web. XML, primarily the address of the CAS server and the address of the client
Configuring debugging
Note the configuration of the JRE here, I have a separate JDK and JRE on my computer, and there is a JRE folder inside the JDK, so let's use it in this https://blog.csdn.net/u010588262/article/details/ 79741626 The 3rd step of this JRE directory can be:
Otherwise the test will be an error when:
Client Registration
The last step, if you are anxious monkeys to start the test, you will encounter the following situation:
At the same time the server will have a warning, can be based on the warning to determine what domain name should be registered
This is because our client's domain name is not registered on the server, registration is very simple
Let's go back to the service side of the project, from overlays or Cas_war (do not get back to see the Server Configuration Blog bar https://blog.csdn.net/u010588262/article/details/79741626) Copy the Services directory into the project:
Added a JSON file:
File name according to the specification with Name-serviceid.json Bar, inside the content is also very good understanding:
-@class: Must be an implementation class for Org.apereo.cas.services.RegisteredService
-ServiceId: An expression describing a service that can be used to match one or more URL addresses
-Name: Service names
-ID: Globally unique flag
-EvaluationOrder: Define the order of execution for multiple services
At the same time, add the following in the application.properties to open the server to read the JSON configuration:
#开启识别json文件, default false
cas.serviceregistry.initfromjson=true
#自动扫描服务配置, enabled
by default Cas.serviceregistry.watcherenabled=true
#120秒扫描一遍
cas.serviceregistry.repeatinterval=120000
# Delay 15 seconds to open
#cas. serviceregistry.startdelay=15000
#资源加载路径
cas.serviceregistry.config.location= Classpath:/services
Here the client is OK, after the successful login is this:
To test multiple client single sign-on, divert is going to have to change the domain name one time.