Class ApiTokenAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.genesys.blocks.tokenauth.spring.ApiTokenAuthenticationToken
- All Implemented Interfaces:
Serializable,Principal,org.springframework.security.core.Authentication,org.springframework.security.core.CredentialsContainer
public class ApiTokenAuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
Authentication implementation for
API Token authentication.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApiTokenAuthenticationToken(Object aPrincipal, Object aCredentials, Collection<? extends org.springframework.security.core.GrantedAuthority> anAuthorities) Constructor used for an authentication response.Constructor used for an authentication request. -
Method Summary
Modifier and TypeMethodDescriptionvoidGet the credentialsGet the principalMethods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
Constructor Details
-
ApiTokenAuthenticationToken
Constructor used for an authentication request. TheAuthentication.isAuthenticated()will returnfalse. The principal is unknown at this stage.- Parameters:
token- The API token
-
ApiTokenAuthenticationToken
public ApiTokenAuthenticationToken(Object aPrincipal, Object aCredentials, Collection<? extends org.springframework.security.core.GrantedAuthority> anAuthorities) Constructor used for an authentication response. TheAuthentication.isAuthenticated()will returntrue.- Parameters:
aPrincipal- The authenticated principalanAuthorities- The granted authorities
-
-
Method Details
-
getCredentials
Get the credentials -
getPrincipal
Get the principal -
eraseCredentials
public void eraseCredentials()- Specified by:
eraseCredentialsin interfaceorg.springframework.security.core.CredentialsContainer- Overrides:
eraseCredentialsin classorg.springframework.security.authentication.AbstractAuthenticationToken
-