org.springframework.security.providers.anonymous
Class AnonymousAuthenticationToken
java.lang.Object
org.springframework.security.providers.AbstractAuthenticationToken
org.springframework.security.providers.anonymous.AnonymousAuthenticationToken
- All Implemented Interfaces:
- java.io.Serializable, java.security.Principal, Authentication
public class AnonymousAuthenticationToken
- extends AbstractAuthenticationToken
- implements java.io.Serializable
Represents an anonymous Authentication
.
- Version:
- $Id: AnonymousAuthenticationToken.java 2217 2007-10-27 00:45:30Z luke_t $
- Author:
- Ben Alex
- See Also:
- Serialized Form
Method Summary |
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
getCredentials()
Always returns an empty String |
int |
getKeyHash()
|
java.lang.Object |
getPrincipal()
The identity of the principal being authenticated. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
AnonymousAuthenticationToken
public AnonymousAuthenticationToken(java.lang.String key,
java.lang.Object principal,
GrantedAuthority[] authorities)
- Constructor.
- Parameters:
key
- to identify if this object made by an authorised clientprincipal
- the principal (typically a UserDetails
)authorities
- the authorities granted to the principal
- Throws:
java.lang.IllegalArgumentException
- if a null
was passed
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interface java.security.Principal
- Overrides:
equals
in class AbstractAuthenticationToken
getCredentials
public java.lang.Object getCredentials()
- Always returns an empty
String
- Specified by:
getCredentials
in interface Authentication
- Returns:
- an empty String
getKeyHash
public int getKeyHash()
getPrincipal
public java.lang.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