Spring安全超时处理程序

时间:2014-12-19 01:42:44

标签: spring jsf spring-security

我正在使用Spring / JSF / PrimeFaces Web应用程序,其中设置了会话超时,

<session-config>
    <session-timeout>10</session-timeout>
</session-config>

并在春季安全

<global-method-security secured-annotations="enabled" />

<http auto-config="true" access-denied-page="/faces/ui/login.xhtml" use-expressions="true">

<form-login login-processing-url="/j_spring_security_check" 
    login-page="/faces/ui/Login.xhtml" 
    default-target-url="/faces/ui/FirstPage.xhtml" 
    authentication-failure-url="/faces/ui/Login.xhtml" 
    authentication-success-handler-ref="authenticationSuccessHandler" />

<logout invalidate-session="true" 
    logout-success-url="/faces/ui/Login.xhtml" 
    delete-cookies="JSESSIONID"
    logout-url="/j_spring_security_logout"/>

<session-management invalid-session-url="/faces/ui/Login.xhtml">
    <concurrency-control error-if-maximum-exceeded="true" max-sessions="2" expired-url="/faces/ui/Login.xhtml" />
</session-management>

 <beans:bean id="authenticationSuccessHandler"
    class="com.app.spring.security.AppSecurityUrlAuthenticationSuccessHandler" />

如何在springsecurity中为超时添加侦听器,这是

所必需的
  1. 对会话失效执行一些自定义操作
  2. 超时后重定向到登录页面(ajax和非ajax) 请求)
  3. 使用

    • 弹簧3.1.1.RELEASE
    • JSF 2.1.11
    • PrimeFaces-4.0-SNAPSHOT

0 个答案:

没有答案