I facing an issue implementing custom authenticationprocessingfiltering. Requesting help
Requirement : Customize a spring security application to bring under single sign-on. The single sign on soln will set users email address in the cookie as after successful login.
Environment : application deployed in Weblogic 10.3 secured using spring security
What is tried: Wrote a custom authenticationprocessingfilter extending the AbstractAuthenticationProcessingFilter and following methods were overridden
1. attemptAuthentication - to do the actual authentication by retrieving the email address using request.getUserPrincipal().getName and passing it to the authentication manager
2.requiresAuthentication - to check whether the requested URL requires authentication or not
3.successfulAuthentication - Redirect to the actual URL requested by client after successful authentication. Here where i have the issue. I wanted to redirect to the actual requested URL rather than defaultTargetURL. I was able to do that, but the actual method uses request.sendredirect rather than request dispatcher. because of this my request object which the client request is getting lost. Is there any specific reason why it is sendRedirect here rather than dispatcher. ??
Moreover i tried by changin it to requestDispatcher and i got the following error
java.net.SocketException: Connection reset by peer: socket write error
Evenif the error is thrown in the server, the application works without any issue. i read that there is nothing to worry abt this exception and we can ignore it, still for me to move it to production env there shouldnt be any warnings in the server. Any one can tell me why exactly with dispatcher this issue is????