Refactored UsernamePasswordAuthenticationToken.getDetails() to Object.

This commit is contained in:
Ben Alex 2004-09-01 21:19:05 +00:00
parent fa2920baa7
commit ec166e086b
3 changed files with 11 additions and 10 deletions

View File

@ -8,6 +8,7 @@ Changes in version 0.x (2004-xx-xx)
* Added FilterToBeanProxy compatibility with ContextLoaderServlet (lazy inits) * Added FilterToBeanProxy compatibility with ContextLoaderServlet (lazy inits)
* Extracted removeUserFromCache(String) to UserCache interface * Extracted removeUserFromCache(String) to UserCache interface
* Improved ConfigAttributeEditor so it trims preceding and trailing spaces * Improved ConfigAttributeEditor so it trims preceding and trailing spaces
* Refactored UsernamePasswordAuthenticationToken.getDetails() to Object
* Fixed EH-CACHE-based caching implementation behaviour when cache exists * Fixed EH-CACHE-based caching implementation behaviour when cache exists
* Fixed Ant "release" target not including project.properties * Fixed Ant "release" target not including project.properties
* Fixed GrantedAuthorityEffectiveAclsResolver if null ACLs provided to method * Fixed GrantedAuthorityEffectiveAclsResolver if null ACLs provided to method

View File

@ -37,10 +37,10 @@ public class UsernamePasswordAuthenticationToken
//~ Instance fields ======================================================== //~ Instance fields ========================================================
private Object credentials; private Object credentials;
private Object details = null;
private Object principal; private Object principal;
private GrantedAuthority[] authorities; private GrantedAuthority[] authorities;
private boolean authenticated = false; private boolean authenticated = false;
private String details = null;
//~ Constructors =========================================================== //~ Constructors ===========================================================
@ -83,15 +83,15 @@ public class UsernamePasswordAuthenticationToken
return this.credentials; return this.credentials;
} }
public Object getPrincipal() { public void setDetails(Object details) {
return this.principal; this.details = details;
} }
public Object getDetails() { public Object getDetails() {
return details; return details;
} }
public void setDetails(String details) { public Object getPrincipal() {
this.details = details; return this.principal;
} }
} }

View File

@ -349,7 +349,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken(principal, UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken(principal,
authentication.getCredentials(), user.getAuthorities()); authentication.getCredentials(), user.getAuthorities());
result.setDetails((authentication.getDetails() != null) result.setDetails((authentication.getDetails() != null)
? authentication.getDetails().toString() : null); ? authentication.getDetails() : null);
return result; return result;
} }