Spring Security: expiring a session without redirecting to expired-url?

I am using Spring Security 3.0.2 forms based authentication. But I cannot understand how I can configure it so that when the session expires, the request is not redirected to another page (expired-url) or displays the message "Session expiration date".

I don’t want forwarding or messages, I want the anonymous session to start the same way as when a user without a session visited the site.

My current configuration:

<http>
  <intercept-url pattern="/login.action*" filters="none"/>
  <intercept-url pattern="/admin/**" access="ROLE_ADMIN" />
  <intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
  <form-login login-page="/login.action"
               authentication-failure-url="/login.action?error=failed"
               login-processing-url="/login-handler.action"/>
  <logout logout-url="/logoff-execute.action"
          logout-success-url="/logoff.action?done=1"/>
  <remember-me key="remember-me-security" services-ref="rememberMeServices"/>
  <session-management >
    <concurrency-control max-sessions="1"
                         error-if-maximum-exceeded="false"
                         expired-url="/login.action?error=expired.url"/>
  </session-management>
</http>
+4
source share
2 answers

I would say that you need to write your own filter.
Take a look at spring docs in infrastructure .

, , - : -.

0

:

    <logout invalidate-session="true"
             logout-url="/LoginPage.jsf?error_logout=logoutComSucesso"/><!--invalido logout-success-url="/LoginPage.jsf?auth_error" -->
    <session-management session-fixation-protection="newSession" invalid-session-url="/LoginPage.jsf?error=sessionExpired"
                    session-authentication-error-url="/LoginPage.jsf?auth_error=BadCredencials" >
    </session-management>
0

All Articles