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