Class BearerTokenAuthentication
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken<OAuth2AccessToken>
org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication
- All Implemented Interfaces:
- Serializable,- Principal,- Authentication,- CredentialsContainer
@Transient
public class BearerTokenAuthentication
extends AbstractOAuth2TokenAuthenticationToken<OAuth2AccessToken>
An 
Authentication token that represents a
 successful authentication as obtained through a bearer token.- Since:
- 5.2
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBearerTokenAuthentication(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, Collection<? extends GrantedAuthority> authorities) Constructs aBearerTokenAuthenticationwith the provided arguments
- 
Method SummaryModifier and TypeMethodDescriptionReturns the attributes of the access token.Methods inherited from class org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationTokengetCredentials, getPrincipal, getTokenMethods inherited from class org.springframework.security.authentication.AbstractAuthenticationTokenequals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
- 
Constructor Details- 
BearerTokenAuthenticationpublic BearerTokenAuthentication(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, Collection<? extends GrantedAuthority> authorities) Constructs aBearerTokenAuthenticationwith the provided arguments- Parameters:
- principal- The OAuth 2.0 attributes
- credentials- The verified token
- authorities- The authorities associated with the given token
 
 
- 
- 
Method Details- 
getTokenAttributesDescription copied from class:AbstractOAuth2TokenAuthenticationTokenReturns the attributes of the access token.- Specified by:
- getTokenAttributesin class- AbstractOAuth2TokenAuthenticationToken<OAuth2AccessToken>
- Returns:
- a Mapof the attributes in the access token.
 
 
-