Class BearerTokenAuthentication
- java.lang.Object
-
- org.springframework.security.authentication.AbstractAuthenticationToken
-
- org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.core.OAuth2AccessToken>
-
- org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Principal,org.springframework.security.core.Authentication,org.springframework.security.core.CredentialsContainer
@Transient public class BearerTokenAuthentication extends AbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.core.OAuth2AccessToken>
AnAuthenticationtoken that represents a successful authentication as obtained through a bearer token.- Since:
- 5.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BearerTokenAuthentication(org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal principal, org.springframework.security.oauth2.core.OAuth2AccessToken credentials, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)Constructs aBearerTokenAuthenticationwith 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(org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal principal, org.springframework.security.oauth2.core.OAuth2AccessToken credentials, java.util.Collection<? extends org.springframework.security.core.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 Detail
-
getTokenAttributes
public java.util.Map<java.lang.String,java.lang.Object> getTokenAttributes()
Description copied from class:AbstractOAuth2TokenAuthenticationTokenReturns the attributes of the access token.- Specified by:
getTokenAttributesin classAbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.core.OAuth2AccessToken>- Returns:
- a
Mapof the attributes in the access token.
-
-