views:

777

answers:

1

I am using form-login for security and I am trying to implement an authentication success handler, but I am not sure how to go back to the resource that was initially requested before the login process. By default I think it implements a SimpleUrlAuthenticationSuccessHandler and I tried to mirror that class implementation. But it sets a setDefaultTargetUrl(defaultTargetUrl) and perhaps thats where the magic happens that it remembers the resource to go back to after the login process.

Any help is greatly appreciated. Below is my spring security <form-login/> element

<form-login login-page="/login.jsp" login-processing-url="/b2broe_login"
        authentication-success-handler-ref="passwordExpiredHandler" 
        authentication-failure-url="/login.jsp?loginfailed=true" />
+1  A: 

Resuming of the initial request is implemented in the SavedRequestAwareAuthenticationSuccessHandler, which is used by default by <form-login>.

axtavt
I see it needs a `HttpSessionRequestCache`. How is that set?
Eqbal
Got it working. Didn't need to worry about HttpSessionRequestCache.
Eqbal

related questions