public class CasAuthenticationToken extends AbstractAuthenticationToken implements java.io.Serializable
Authentication
.Constructor and Description |
---|
CasAuthenticationToken(java.lang.String key,
java.lang.Object principal,
java.lang.Object credentials,
java.util.Collection<? extends GrantedAuthority> authorities,
UserDetails userDetails,
org.jasig.cas.client.validation.Assertion assertion)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
org.jasig.cas.client.validation.Assertion |
getAssertion() |
java.lang.Object |
getCredentials()
The credentials that prove the principal is correct.
|
int |
getKeyHash() |
java.lang.Object |
getPrincipal()
The identity of the principal being authenticated.
|
UserDetails |
getUserDetails() |
java.lang.String |
toString() |
eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails
public CasAuthenticationToken(java.lang.String key, java.lang.Object principal, java.lang.Object credentials, java.util.Collection<? extends GrantedAuthority> authorities, UserDetails userDetails, org.jasig.cas.client.validation.Assertion assertion)
key
- to identify if this object made by a given
CasAuthenticationProvider
principal
- typically the UserDetails object (cannot be null
)credentials
- the service/proxy ticket ID from CAS (cannot be
null
)authorities
- the authorities granted to the user (from the
UserDetailsService
) (cannot
be null
)userDetails
- the user details (from the
UserDetailsService
) (cannot
be null
)assertion
- the assertion returned from the CAS servers. It contains the
principal and how to obtain a proxy ticket for the user.java.lang.IllegalArgumentException
- if a null
was passedpublic boolean equals(java.lang.Object obj)
equals
in interface java.security.Principal
equals
in class AbstractAuthenticationToken
public java.lang.Object getCredentials()
Authentication
AuthenticationManager
. Callers
are expected to populate the credentials.getCredentials
in interface Authentication
Principal
public int getKeyHash()
public java.lang.Object getPrincipal()
Authentication
The AuthenticationManager implementation will often return an
Authentication containing richer information as the principal for use by
the application. Many of the authentication providers will create a
UserDetails
object as the principal.
getPrincipal
in interface Authentication
Principal
being authenticated or the authenticated
principal after authentication.public org.jasig.cas.client.validation.Assertion getAssertion()
public UserDetails getUserDetails()
public java.lang.String toString()
toString
in interface java.security.Principal
toString
in class AbstractAuthenticationToken