Spring Security Framework

org.springframework.security.adapters
Class PrincipalSpringSecurityUserToken

java.lang.Object
  extended by org.springframework.security.providers.AbstractAuthenticationToken
      extended by org.springframework.security.adapters.AbstractAdapterAuthenticationToken
          extended by org.springframework.security.adapters.PrincipalSpringSecurityUserToken
All Implemented Interfaces:
Serializable, Principal, AuthByAdapter, Authentication

public class PrincipalSpringSecurityUserToken
extends AbstractAdapterAuthenticationToken
implements Principal

A Principal compatible Authentication object.

Version:
$Id$
Author:
Ben Alex
See Also:
Serialized Form

Constructor Summary
PrincipalSpringSecurityUserToken(String key, String username, String password, GrantedAuthority[] authorities, Object principal)
           
 
Method Summary
 Object getCredentials()
          The credentials that prove the principal is correct.
 String getName()
           
 Object getPrincipal()
          The identity of the principal being authenticated.
 
Methods inherited from class org.springframework.security.adapters.AbstractAdapterAuthenticationToken
equals, getKeyHash, isAuthenticated, isUserInRole, setAuthenticated
 
Methods inherited from class org.springframework.security.providers.AbstractAuthenticationToken
getAuthorities, getDetails, hashCode, setDetails, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 
Methods inherited from interface org.springframework.security.Authentication
getAuthorities, getDetails
 

Constructor Detail

PrincipalSpringSecurityUserToken

public PrincipalSpringSecurityUserToken(String key,
                                        String username,
                                        String password,
                                        GrantedAuthority[] authorities,
                                        Object principal)
Method Detail

getCredentials

public Object getCredentials()
Description copied from interface: Authentication
The credentials that prove the principal is correct. This is usually a password, but could be anything relevant to the AuthenticationManager. Callers are expected to populate the credentials.

Specified by:
getCredentials in interface Authentication
Returns:
the credentials that prove the identity of the Principal

getName

public String getName()
Specified by:
getName in interface Principal
Overrides:
getName in class AbstractAuthenticationToken

getPrincipal

public Object getPrincipal()
Description copied from interface: Authentication
The identity of the principal being authenticated. This is usually a username. Callers are expected to populate the principal.

Specified by:
getPrincipal in interface Authentication
Returns:
the Principal being authenticated

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.