public class ExpiringUsernameAuthenticationToken
extends org.springframework.security.authentication.UsernamePasswordAuthenticationToken
UsernamePasswordAuthenticationToken
.Constructor and Description |
---|
ExpiringUsernameAuthenticationToken(Date tokenExpiration,
Object principal,
Object credentials,
Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
Should only be used by authenticationManager as specified in
UsernamePasswordAuthenticationToken . |
ExpiringUsernameAuthenticationToken(Object principal,
Object credentials) |
Modifier and Type | Method and Description |
---|---|
void |
eraseCredentials()
SAML credentials can be kept without clearing.
|
Date |
getTokenExpiration() |
boolean |
isAuthenticated() |
getCredentials, getPrincipal, setAuthenticated
equals, getAuthorities, getDetails, getName, hashCode, setDetails, toString
public ExpiringUsernameAuthenticationToken(Object principal, Object credentials)
principal
- principalcredentials
- credentialUsernamePasswordAuthenticationToken.UsernamePasswordAuthenticationToken(Object, Object)
public ExpiringUsernameAuthenticationToken(Date tokenExpiration, Object principal, Object credentials, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
UsernamePasswordAuthenticationToken
. In
case the tokenExpiration is not null the calls to the isAuthenticated method will return false after
the current time is beyond the tokenExpiration. No functionality is changed when tokenExpiration is null.tokenExpiration
- null or date after which the token is not valid anymoreprincipal
- principalcredentials
- credentialsauthorities
- authoritiespublic boolean isAuthenticated()
isAuthenticated
in interface org.springframework.security.core.Authentication
isAuthenticated
in class org.springframework.security.authentication.AbstractAuthenticationToken
public Date getTokenExpiration()
public void eraseCredentials()
eraseCredentials
in interface org.springframework.security.core.CredentialsContainer
eraseCredentials
in class org.springframework.security.authentication.UsernamePasswordAuthenticationToken