cas 4.2.x 单点登出

来源:互联网 发布:etf套利交易软件 编辑:程序博客网 时间:2024/05/22 12:26

上一篇是cas配置shiro,这次说一说单点登出.特别感谢 白夜船长大神 !


cas配置shiro:http://blog.csdn.net/mr_yangzc/article/details/69396622

依然给出官方文档,https://apereo.github.io/cas/4.2.x/installation/Logout-Single-Signout.html


单点登出非常简单  在client web.xml中配置

<!-- 单点登出 -->
    <listener>
        <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
    </listener>
    <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>


这里也许会有人在项目启动时候报错:

java.lang.IllegalArgumentException: casServerUrlPrefix cannot be null.

原因也非常简单,jar包版本不对 解决方法:




在 cas server   中的 cas.properties中进行配置:


# Specify whether CAS should redirect to the specified service parameter on /logout requests
# cas.logout.followServiceRedirects=false
cas.logout.followServiceRedirects=true



##
# Single Logout Out Callbacks
#
# To turn off all back channel SLO requests set this to true
# slo.callbacks.disabled=false

 slo.callbacks.disabled=false




#
# To send callbacks to endpoints synchronously, set this to false
# slo.callbacks.asynchronous=true
slo.callbacks.asynchronous=true







0 0
原创粉丝点击