Class OAuth2AccessTokenAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.oauth2.server.authorization.authentication.OAuth2AccessTokenAuthenticationToken
- All Implemented Interfaces:
Serializable,Principal,org.springframework.security.core.Authentication,org.springframework.security.core.CredentialsContainer
public class OAuth2AccessTokenAuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
An
Authentication implementation used when issuing an OAuth 2.0 Access Token
and (optional) Refresh Token.- Since:
- 0.0.1
- See Also:
-
AbstractAuthenticationTokenRegisteredClientOAuth2AccessTokenOAuth2RefreshTokenOAuth2ClientAuthenticationToken- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionOAuth2AccessTokenAuthenticationToken(RegisteredClient registeredClient, org.springframework.security.core.Authentication clientPrincipal, org.springframework.security.oauth2.core.OAuth2AccessToken accessToken) Constructs anOAuth2AccessTokenAuthenticationTokenusing the provided parameters.OAuth2AccessTokenAuthenticationToken(RegisteredClient registeredClient, org.springframework.security.core.Authentication clientPrincipal, org.springframework.security.oauth2.core.OAuth2AccessToken accessToken, org.springframework.security.oauth2.core.OAuth2RefreshToken refreshToken) Constructs anOAuth2AccessTokenAuthenticationTokenusing the provided parameters.OAuth2AccessTokenAuthenticationToken(RegisteredClient registeredClient, org.springframework.security.core.Authentication clientPrincipal, org.springframework.security.oauth2.core.OAuth2AccessToken accessToken, org.springframework.security.oauth2.core.OAuth2RefreshToken refreshToken, Map<String, Object> additionalParameters) Constructs anOAuth2AccessTokenAuthenticationTokenusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.core.OAuth2AccessTokenReturns theaccess token.Returns the additional parameters.org.springframework.security.oauth2.core.OAuth2RefreshTokenReturns therefresh token.Returns theregistered client.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
Constructor Details
-
OAuth2AccessTokenAuthenticationToken
public OAuth2AccessTokenAuthenticationToken(RegisteredClient registeredClient, org.springframework.security.core.Authentication clientPrincipal, org.springframework.security.oauth2.core.OAuth2AccessToken accessToken) Constructs anOAuth2AccessTokenAuthenticationTokenusing the provided parameters.- Parameters:
registeredClient- the registered clientclientPrincipal- the authenticated client principalaccessToken- the access token
-
OAuth2AccessTokenAuthenticationToken
public OAuth2AccessTokenAuthenticationToken(RegisteredClient registeredClient, org.springframework.security.core.Authentication clientPrincipal, org.springframework.security.oauth2.core.OAuth2AccessToken accessToken, @Nullable org.springframework.security.oauth2.core.OAuth2RefreshToken refreshToken) Constructs anOAuth2AccessTokenAuthenticationTokenusing the provided parameters.- Parameters:
registeredClient- the registered clientclientPrincipal- the authenticated client principalaccessToken- the access tokenrefreshToken- the refresh token
-
OAuth2AccessTokenAuthenticationToken
public OAuth2AccessTokenAuthenticationToken(RegisteredClient registeredClient, org.springframework.security.core.Authentication clientPrincipal, org.springframework.security.oauth2.core.OAuth2AccessToken accessToken, @Nullable org.springframework.security.oauth2.core.OAuth2RefreshToken refreshToken, Map<String, Object> additionalParameters) Constructs anOAuth2AccessTokenAuthenticationTokenusing the provided parameters.- Parameters:
registeredClient- the registered clientclientPrincipal- the authenticated client principalaccessToken- the access tokenrefreshToken- the refresh tokenadditionalParameters- the additional parameters
-
-
Method Details
-
getPrincipal
-
getCredentials
-
getRegisteredClient
Returns theregistered client.- Returns:
- the
RegisteredClient
-
getAccessToken
public org.springframework.security.oauth2.core.OAuth2AccessToken getAccessToken()Returns theaccess token.- Returns:
- the
OAuth2AccessToken
-
getRefreshToken
@Nullable public org.springframework.security.oauth2.core.OAuth2RefreshToken getRefreshToken()Returns therefresh token.- Returns:
- the
OAuth2RefreshTokenornullif not available
-
getAdditionalParameters
Returns the additional parameters.- Returns:
- a
Mapof the additional parameters, may be empty
-