SEC-1430: Removed caching of username in session upon failed authentication. Improved Javadoc.
This commit is contained in:
-14
@@ -123,8 +123,6 @@ public class OpenIDAuthenticationFilter extends AbstractAuthenticationProcessing
|
||||
|
||||
if (!StringUtils.hasText(identity)) {
|
||||
String claimedIdentity = obtainUsername(request);
|
||||
// Make the username available to the view
|
||||
setLastUsername(claimedIdentity, request);
|
||||
|
||||
try {
|
||||
String returnToUrl = buildReturnToUrl(request);
|
||||
@@ -159,21 +157,9 @@ public class OpenIDAuthenticationFilter extends AbstractAuthenticationProcessing
|
||||
// delegate to the authentication provider
|
||||
Authentication authentication = this.getAuthenticationManager().authenticate(token);
|
||||
|
||||
if (authentication.isAuthenticated()) {
|
||||
setLastUsername(token.getIdentityUrl(), request);
|
||||
}
|
||||
|
||||
return authentication;
|
||||
}
|
||||
|
||||
private void setLastUsername(String username, HttpServletRequest request) {
|
||||
HttpSession session = request.getSession(false);
|
||||
|
||||
if (session != null || getAllowSessionCreation()) {
|
||||
request.getSession().setAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY, username);
|
||||
}
|
||||
}
|
||||
|
||||
protected String lookupRealm(String returnToUrl) {
|
||||
String mapping = realmMapping.get(returnToUrl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user