Shiro-cas single-point exit and shiro-cas single-point exit
Single-point exit after shiro and CAS are integrated
After exiting any application, all applications must log on again.
Implementation idea shiro redirects to cas again after exiting the system
1. reconfigure the logout jump of shiro
Go to cas exit after shiro exits
After cas exits, it uses the service parameter to jump to the response page
Xml Code
<Bean id = "logout" class = "org. apache. shiro. web. filter. authc. LogoutFilter">
<Property name = "redirectUrl"
Value = "http: // localhost: 7070/cas/logout? Service = http: // localhost: 8088/pwenter/cas-login "/>
</Bean>
<bean id="logout" class="org.apache.shiro.web.filter.authc.LogoutFilter"> <property name="redirectUrl" value="http://localhost:7070/cas/logout?service=http://localhost:8088/pwenter/cas-login"/></bean>
2. Override shiro's default exit implementation
Overwrite the configured logout with shiro's default logout.
Xml Code
<Property name = "filters">
<Util: map>
<Entry key = "authc" value-ref = "formAuthenticationFilter"/>
<Entry key = "cas" value-ref = "casFilter"/>
<Entry key = "logout" value-ref = "logout"/>
</Util: map>
</Property>
<property name="filters"><util:map><entry key="authc" value-ref="formAuthenticationFilter" /><entry key="cas" value-ref="casFilter" /><entry key="logout" value-ref="logout" /></util:map></property>
3. Open cas's exit redirection switch to modify the cas-servlet.xml file in cas
Change the cas. logout. followServiceRedirects: false attribute to cas. logout. followServiceRedirects: true.
Xml Code
<Bean id = "logoutAction" class = "org. jasig. cas. web. flow. LogoutAction"
P: servicesManager-ref = "servicesManager"
P: followServiceRedirects = "$ {cas. logout. followServiceRedirects: true}"/>
<bean id="logoutAction" class="org.jasig.cas.web.flow.LogoutAction" p:servicesManager-ref="servicesManager" p:followServiceRedirects="${cas.logout.followServiceRedirects:true}"/>
Java enterprise-level general permission security framework source code SpringMVC mybatis or hibernate + ehcache shiro druid bootstrap HTML5
[Download java framework source code]