
Originally Posted by
adepue
The system will use the username, as entered by the user, to perform the cache lookup.
The one and only time the username manually entered by the username will be used is when AuthenticationProcessingFilter.attemptAuthenticati on(HttpServletRequest) is called. The abstract parent coordinates workflow as follows:
Code:
Authentication authResult;
try {
authResult = attemptAuthentication(httpRequest);
} catch (SomeStuff .....)
}
httpRequest.getSession().setAttribute(ACEGI_SECURITY_LAST_EXCEPTION_KEY,
failed);
httpRequest.getSession().removeAttribute(HttpSessionIntegrationFilter.ACEGI_SECURITY_AUTHENTICATION_KEY);
httpResponse.sendRedirect(httpResponse.encodeRedirectURL(httpRequest
.getContextPath() + failureUrl));
return;
}
// Authentication success
if (logger.isDebugEnabled()) {
logger.debug("Authentication success: " + authResult.toString());
}
httpRequest.getSession().setAttribute(HttpSessionIntegrationFilter.ACEGI_SECURITY_AUTHENTICATION_KEY,
authResult);
As shown, the Authentication returned from DaoAuthenticationProvider (which should contain the CORRECT case for its principal, indeed its principal is more often than not the UserDetails instance) and that should be used on subsequent requests (as HttpSessionIntegrationFilter will obtain the stored Authentication from HttpSession and put it into ContextHolder on each request). The case originally used by the user to login (via AbstractProcessingFilter) should never be presented a second time.
If you believe there's a problem Andy, would you please tell me which class(es) it's in so I can try to follow.