CAS 5.2.6 single point login user defined login verification and registration process in subsystem

Cas Server configuration
Create a src/main/resources folder, find the file in the WEB-INF of cas, then modify the html file page, and add a new button.

Find the messages ABCD cn.properties file under WEB-INF and add a message, which is the text of the registration button.

Then add it under the messages.properties file

Configuration of subsystem
Configuring filters in the web.xml file
Subsystem configuration

	<filter>
    	<filter-name>CAS Authentication Filter</filter-name>
    <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
   <init-param>
       <param-name>casServerLoginUrl</param-name>
       <param-value>http://IP: Port No. / CAS / login < / param value >
   </init-param>
    <init-param>
        <param-name>casServerLogoutUrl</param-name>
        <param-value>http://IP: Port No. / CAS < / param value >
    </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>http://IP: port number / < / param value >
    </init-param>
    **<init-param>
        <param-name>ignorePattern</param-name>
        <param-value>users/registeredAccount|users/add</param-value>
    </init-param>
</filter>**

<filter>
   <!--  Used for ticket Authentication -->
    <filter-name>CAS Validation Filter</filter-name>
    <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
    <init-param>
        <!-- ticket The authentication address. The intranet address is configured here -->
        <param-name>casServerUrlPrefix</param-name>
        <param-value>http://IP: Port No. / CAS < / param value >
    </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>http://IP: port number / < / param value >
    </init-param>
    <init-param>
        <param-name>redirectAfterValidation</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>acceptAnyProxy</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>useSession</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>utf-8</param-value>
    </init-param>
</filter>
	<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
	<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</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 Single Sign Out Filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>CAS Authentication Filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>CAS Validation Filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>CAS Assertion Thread Local Filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener> 
<!-- ======================== Single sign on/End of logout ======================== -->

Note: if you choose to register in the subsystem, you need to set cas filter to ignore the url of the registration page and the url of the registration submission jump;

User defined login verification in subsystem
1. Create a class to implement the PasswordEncoder interface

2. Configure mongodb settings in the application.properties file

Configuration complete! I use version 5.2.6.

Tags: xml encoding Session MongoDB

Posted on Tue, 03 Dec 2019 06:43:49 -0500 by adeenutza