Windows implementation steps:
Server.xml Modification Method
Hosts modify mode
CAS Client Configuration
CAS configuration filter.txt content is as follows:
<!--======================== Single Sign-on start ======================== - <!--for single-point exit, this filter is used for single-point logout functions, optional configuration - <Listener> <Listener-class>Org.jasig.cas.client.session.SingleSignOutHttpSessionListener</Listener-class> </Listener> <!--This filter is used to implement the single-point logout function, optional configuration. - <Filter> <Filter-name>CAS Single Sign Out Filter</Filter-name> <Filter-class>Org.jasig.cas.client.session.SingleSignOutFilter</Filter-class> </Filter> <filter-mapping> <Filter-name>CAS Single Sign Out Filter</Filter-name> <Url-pattern>/*</Url-pattern> </filter-mapping> <!--This filter is responsible for the user's certification work and must be enabled - <Filter> <Filter-name>Casfilter</Filter-name> <Filter-class>Org.jasig.cas.client.authentication.AuthenticationFilter</Filter-class> <Init-param> <Param-name>Casserverloginurl</Param-name> <!--This is the address of the CAS server, you must use the domain name you created, or the authentication certificate does not pass - <Param-value>Https://www.bhz.com:8443/cas/login</Param-value> </Init-param> <Init-param> <Param-name>ServerName</Param-name> <!--the server here is the IP of the service side - <Param-value>http://localhost:8080</Param-value> </Init-param> </Filter> <filter-mapping> <Filter-name>Casfilter</Filter-name> <Url-pattern>/*</Url-pattern> </filter-mapping> <!--the filter is responsible for verifying the ticket, and it must be enabled - <Filter> <Filter-name>CAS Validation Filter</Filter-name> <Filter-class>Org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</Filter-class> <Init-param> <Param-name>Casserverurlprefix</Param-name> <!--This is the address of the CAS server, you must use the domain name you created, or the authentication certificate does not pass - <Param-value>Https://www.bhz.com:8443/cas</Param-value> </Init-param> <Init-param> <Param-name>ServerName</Param-name> <Param-value>http://localhost:8080</Param-value> </Init-param> </Filter> <filter-mapping> <Filter-name>CAS Validation Filter</Filter-name> <Url-pattern>/*</Url-pattern> </filter-mapping> <!--the filter is responsible for implementing the package requested by the HttpServletRequest, such as allowing the developer to obtain the login name of the SSO login user through the HttpServletRequest getremoteuser () method, optional configuration. - <Filter> <Filter-name>CAS HttpServletRequest Wrapper Filter</Filter-name> <Filter-class>Org.jasig.cas.client.util.HttpServletRequestWrapperFilter</Filter-class> </Filter> <filter-mapping> <Filter-name>CAS HttpServletRequest Wrapper Filter</Filter-name> <Url-pattern>/*</Url-pattern> </filter-mapping> <!--This filter allows developers to get the user's login name through Org.jasig.cas.client.util.AssertionHolder. such as Assertionholder.getassertion (). Getprincipal (). GetName (). - <Filter> <Filter-name>CAS Assertion Thread Local Filter</Filter-name> <Filter-class>Org.jasig.cas.client.util.AssertionThreadLocalFilter</Filter-class> </Filter> <filter-mapping> <Filter-name>CAS Assertion Thread Local Filter</Filter-name> <Url-pattern>/*</Url-pattern> </filter-mapping> <!--======================== Single Sign-on end ======================== - <!--automatically set the user information of the system according to the results of single sign-on - <Filter> <Filter-name>Authvalidatefilter</Filter-name> <Filter-class>Bhz.com.util.AuthValidateFilter</Filter-class> </Filter> <filter-mapping> <Filter-name>Authvalidatefilter</Filter-name> <Servlet-name>Bhz-sys</Servlet-name> </filter-mapping>
View Code
Single Sign-on Windows implementation