The 'authenticationDetailsSource' is something different then the 'userDetailsService'... So I don't see the comparison you make.
The UserDetailsService implementation returns a UserDetail instance. The AuthenticationDetailsSource adds some additional information to the RememberMeAuthenticationToken to enable for instance ConcurrentSessionFilter to work (it adds the current sessionId etc.). But is doesn't override the already set UserDetails object...
The UserDetails object is available with the getPrincipal method and not the getDetails method! Also the details object isn't even being set in the initial constructor.
Code:
public RememberMeAuthenticationToken(String key, Object principal, GrantedAuthority[] authorities) {
super(authorities);
if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal)) {
throw new IllegalArgumentException("Cannot pass null or empty values to constructor");
}
this.keyHash = key.hashCode();
this.principal = principal;
setAuthenticated(true);
}
Code:
public void setDetails(Object details) {
this.details = details;
}
the set details method only sets the details property nothing more nothing less. It doesn't do anything with the principal object (which isn't even accesible!).