Oct 2nd, 2012, 04:00 AM
Forwarding instead of redirecting on authentication success
Hi all !
Mobile phone Ajax request do not support HTTP 302 for authentication requests.
The SimpleUrlAuthenticationFailureHandler supports request forwarding instead of redirecting, but not its counterpart, the SimpleUrlAuthenticationSuccessHandler.
Is this on purpose (to avoid caching authentication request, but you generally do not want to cache POST requests) ? Did I miss some configuration part ?
To cleanly add forward behavior to this success handler, I injected a special RedirectStrategy that does the forward, but I am not very satisfied of this solution :
- A RedirectStrategy that forwards requests instead is not very clean,
- I have to define the AuthenticationSuccess bean outside of the <form-login> element (this point is less annoying, and could not be avoidable)
Could someone show be the light ?
Thank you !
Oct 2nd, 2012, 07:40 PM
You should be able to follow the redirects. If you do not want to do this, then creating an AuthenticationSuccessHandler that does the forward should work.
Tags for this Thread