Spring JASIG CAS-每个用户帐户只允许一个会话
在JASIG CAS作为身份验证服务器的帮助下,我们在应用程序中实现了“单点登录” 现在,我们需要有一个设置,其中每个用户只能在CAS中创建一个会话/票证Spring JASIG CAS-每个用户帐户只允许一个会话,spring,spring-security,single-sign-on,cas,Spring,Spring Security,Single Sign On,Cas,在JASIG CAS作为身份验证服务器的帮助下,我们在应用程序中实现了“单点登录” 现在,我们需要有一个设置,其中每个用户只能在CAS中创建一个会话/票证 如果用户试图从其他系统/浏览器登录,CAS将使该用户的当前票证无效,并将其从上一个会话/浏览器注销。最后,我自己找到了问题的解决方案。希望它能帮助别人 Jasig Cas本身使用内存映射来跟踪分配给用户的票证。我正在使用类似的方法来达到要求:- 为了实现功能,项目中添加了一些附加功能。变化如下:- “SingleSesionTicketReg
如果用户试图从其他系统/浏览器登录,CAS将使该用户的当前票证无效,并将其从上一个会话/浏览器注销。最后,我自己找到了问题的解决方案。希望它能帮助别人 Jasig Cas本身使用内存映射来跟踪分配给用户的票证。我正在使用类似的方法来达到要求:- 为了实现功能,项目中添加了一些附加功能。变化如下:-
#Toggle the feature if Single Session.
is.single.sesion.per.user=true
#MySQL query to check the authentication.
user.authentication.sql=select password from user where email=? and is_active=1
/src/main/webapp/WEB-INF/spring配置/ticketRegistry.xml
<!--Comment the default ticket regitry. -->
<!-- <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" /> -->
<!--Add the custom ticket regitry. -->
<bean id="ticketRegistry" class="com.naval.cas.SingleSesionTicketRegistry"
p:isSingleSesionPerUser="${is.single.sesion.per.user}"
p:logoutManager-ref="logoutManager"/>
/src/main/webapp/WEB-INF/deployerConfigContext.xml
<!--Add the Following code block -->
<bean id="passwordEncoder"
class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder"
c:encodingAlgorithm="MD5"
p:characterEncoding="UTF-8" />
<bean id="primaryAuthenticationHandler"
class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler"
p:dataSource-ref="dataSource"
p:passwordEncoder-ref="passwordEncoder"
p:sql="${user.authentication.sql}" />
单会话票证注册表类可以在下面的github repo中找到