CAS3.4版本已经很好的支持了单点注销功能,效果是非常的棒,配置是相当的简单。
之前版本因为在CAS服务器通过HttpClient发送消息时并未指定为POST方式,所以在CAS客户端的注销Filter中没有收到POST请求也就没有做session销毁处理。
现在的版本只要按照官网的说明正确配置即可。
假设环境如下:
两个业务系统APP1和APP2
在没有配置单点退出时,效果是这样子的
1:登录APP1,然后经过CAS认证后进入APP1
再访问APP2无需要认证
2:在APP1中连接到cas的logout地址,现象注销成功界面,然后再访问APP1,还是可以进去的,因为APP1将用户的登录票据存入了session。
那么实现了单点退出后的效果应该是这样子的:
1:登录APP1,然后经过CAS认证后进入APP1
再访问APP2无需要认证
2:用户在APP1或者APP2点击注销,显示CAS的注销成功页面,然后再访问APP1或者APP2都需要再次认证。
具体配置为:
在APP1和APP2的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>
注销的Filter要在其它Filter之前
界面的注销连接到CAS的logout地址,如http://localhost:8080/cas/logout
完事
备注:如果直接访问CAS的logout话,会出现注销成功页面,其实大部分情况下这个页面是没有必要的,更多的需求可能是退出后显示登录页面,并且登录成功后还是会进入到之前的业务系统,那么可以修改cas-servlet.xml文件,在"logoutController"的bean配置中增加属性“followServiceRedirects”,设置为“true”,然后在业务系统的注销连接中加入"service参数",值为业务系统的绝对URL,这样就OK了,如你的业务系统URL为:http://localhost:8080/casClient,那么注销URL就为:http://localhost:8080/cas/logout?service=http://localhost:8080/casClient
分享到:
相关推荐
8.3.3.5 Packet Tracer - Configuring Basic OSPFv3 in a Single Area Cisco Packet Tracer 思科模拟器 正确答案文件 可直接上交正确答案文件 本答案版权归mewhaku所有,严禁再次转载!!! Copyright @mewhaku ...
CISCO官方配置手册Cisco - Configuring RSTP and MSTP
Configuring Siebel Business Applications
Configuring OSPF Authentication OSPF实验配置指南,认证配置方法,拓扑图,实验过程,实验现象。
Configuring Hardware with STEP 7pdf,Configuring Hardware with STEP 7
Configuring Altera FPGAs ,Device Configuration Overview for Passive Schemes.
PyCharm配置Windows10 WSL的Python环境 PyCharm Configuring Remote Interpreter via WSL
Configuring Controller 8.2 to use Active Directory authentication
4.1.1.11 Packet Tracer - Configuring Extended ACLs Scenario 2.pka
配置OSPF的外部路由汇总。拓扑,实验步骤,实验现象。
Cisco Configuring Voice VLAN
Configuring TwinCAT For AM335x
mcsa考试题库。exam:70-410 。Installing and Configuring Windows Server 2012 R2
Prepare for Microsoft Exam 70-410 – and help demonstrate your real-world mastery of implementing and configuring core services in Windows Server 2012 R2. Designed for experienced IT professionals ...
在安装SQL时遇到挂起问题,出现安装程序配置服务器失败参考服务器错误日志,运行相应文本就行,操作简单
很详细的ERP Sales and Distribution,收入确认等
Cisco Configuring Frame Relay