5
votes

I'm using Spring Security 3.0.2 form based authentication. But I can't figure out how I can configure it so that when a session expires that the request is not redirect to an other page (expired-url) or displays a 'session expires' message.

I don't want any redirect or messages, I want that a anonymous session is started just like when a user without a session enters the website.

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>
2
Could you solve this issue?Jop.pop

2 Answers

0
votes

I would say you have to write your own filter.
Take a look at the spring framework docs.

There is also a very dusty sample but I think it's still quite correct: timeout filter sample.

0
votes

You can try:

    <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>