As a result of the project needs to achieve a single point of logout need to find on-line n long finally realized single point logout.
Using Cas-server-core-3.3.3.jar (CAS server 3.3.3)
Using Cas-client-core-3.1.3.jar (CAS client 3.1.3)
Project combined with CAS springsecurity SSH
Normal projects (without spring Security) can include the following code in Web. xml
[XHTML] view plain copy <filter> <filter-name>cas Single Sign Out filter</filter-name> <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class> </filter> <fi Lter-mapping> <filter-name>cas Single Sign out filter</filter-name> <url-pattern>/*</url -pattern> </filter-mapping> <listener> <listener-class> org.jasig.cas.client.se Ssion. Singlesignouthttpsessionlistener </listener-class> </listener>
In our project, thanks to the combination of springsecurity, you can add the filter to the spring security filter chain, or you can add it directly to the Web. xml
First, add the listener to Web. Xml.
[XHTML] view Plain copy <!--Single Sign out--<listener> <listener-class> Org.jasig.cas.client.session.SingleSignOutHttpSessionListener </listener-class> </listener> & lt;! -----
Then add the filter to the Spring security filter chain
[XHTML] view Plain Copy <!-----<b:bean id= "Cassinglesignoutfilter" class= "check. Singlesignoutfilter "> <custom-filter before=" cas_processing_filter "/> </b:bean> <!--single Si GN Out--
Note The above class= "check. Singlesignoutfilter "Is my custom filter (because the Singlesignoutfilter defined by CAS3.1.3 does not work in some sense) see http://www.javaeye.com/topic/546785
Define a class of your own
[Java] view plain copy package check;