Now sets WebAuthenticationDetails on authentication request token.

This commit is contained in:
Luke Taylor 2005-03-12 20:46:58 +00:00
parent acee1ef696
commit c3c5487b93

View File

@ -100,8 +100,8 @@ public class X509ProcessingFilter implements Filter, InitializingBean {
try {
X509AuthenticationToken authRequest = new X509AuthenticationToken(clientCertificate);
// authRequest.setDetails(new WebAuthenticationDetails(request));
authRequest.setDetails(new WebAuthenticationDetails(httpRequest));
authResult = authenticationManager.authenticate(authRequest);
successfulAuthentication(httpRequest, httpResponse, authResult);
} catch (AuthenticationException failed) {
@ -118,8 +118,9 @@ public class X509ProcessingFilter implements Filter, InitializingBean {
return certs[0];
}
if(logger.isDebugEnabled())
logger.debug("No client certificate found in request, authentication will fail.");
if (logger.isDebugEnabled()) {
logger.debug("No client certificate found in request.");
}
return null;
}
@ -128,8 +129,7 @@ public class X509ProcessingFilter implements Filter, InitializingBean {
* Puts the <code>Authentication</code> instance returned by the authentication manager into
* the secure context.
*/
protected void successfulAuthentication(HttpServletRequest request,
HttpServletResponse response, Authentication authResult)
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult)
throws IOException {
if (logger.isDebugEnabled()) {
@ -156,11 +156,8 @@ public class X509ProcessingFilter implements Filter, InitializingBean {
request.getSession().setAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY, failed);
}
public void init(FilterConfig filterConfig) throws ServletException { }
public void destroy() { }
}