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
ConstructorDescriptionBearerTokenAuthentication
(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, Collection<? extends GrantedAuthority> authorities) Constructs aBearerTokenAuthentication
with 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, getToken
Methods 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 aBearerTokenAuthentication
with 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:AbstractOAuth2TokenAuthenticationToken
Returns the attributes of the access token.- Specified by:
getTokenAttributes
in classAbstractOAuth2TokenAuthenticationToken<OAuth2AccessToken>
- Returns:
- a
Map
of the attributes in the access token.
-