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:
java.io.Serializable
,java.security.Principal
,Authentication
,CredentialsContainer
@Transient public class BearerTokenAuthentication extends AbstractOAuth2TokenAuthenticationToken<OAuth2AccessToken>
AnAuthentication
token that represents a successful authentication as obtained through a bearer token.- Since:
- 5.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BearerTokenAuthentication(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, java.util.Collection<? extends GrantedAuthority> authorities)
Constructs aBearerTokenAuthentication
with the provided arguments
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getTokenAttributes()
Returns 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 Detail
-
BearerTokenAuthentication
public BearerTokenAuthentication(OAuth2AuthenticatedPrincipal principal, OAuth2AccessToken credentials, java.util.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 Detail
-
getTokenAttributes
public java.util.Map<java.lang.String,java.lang.Object> 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.
-
-