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 Summary
ConstructorsConstructorDescriptionBearerTokenAuthentication(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, Collection<? extends GrantedAuthority> authorities) Constructs aBearerTokenAuthenticationwith the provided arguments -
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes of the access token.Methods inherited from class org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken
getCredentials, getPrincipal, getTokenMethods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
Constructor Details
-
BearerTokenAuthentication
public BearerTokenAuthentication(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, Collection<? extends GrantedAuthority> authorities) Constructs aBearerTokenAuthenticationwith the provided arguments- Parameters:
principal- The OAuth 2.0 attributescredentials- The verified tokenauthorities- The authorities associated with the given token
-
-
Method Details
-
getTokenAttributes
Description copied from class:AbstractOAuth2TokenAuthenticationTokenReturns the attributes of the access token.- Specified by:
getTokenAttributesin classAbstractOAuth2TokenAuthenticationToken<OAuth2AccessToken>- Returns:
- a
Mapof the attributes in the access token.
-