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:
- 7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>Nested classes/interfaces inherited from interface org.springframework.security.core.Authentication
org.springframework.security.core.Authentication.Builder<B> -
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, @Nullable 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, @Nullable 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.@Nullable 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, toStringMethods inherited from interface org.springframework.security.core.Authentication
toBuilder
-
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
public @Nullable org.springframework.security.oauth2.core.OAuth2RefreshToken getRefreshToken()Returns therefresh token.- Returns:
- the
OAuth2RefreshTokenornullif not available
-
getAdditionalParameters
-