public class OAuth2AuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
AbstractAuthenticationToken that represents an OAuth
2.0 Authentication.
The Authentication associates an OAuth2User Principal to the
identifier of the Authorized Client, which
the End-User (Principal) granted authorization to so that it can access it's
protected resources at the UserInfo Endpoint.
AbstractAuthenticationToken,
OAuth2User,
OAuth2AuthorizedClient,
Serialized Form| Constructor and Description |
|---|
OAuth2AuthenticationToken(org.springframework.security.oauth2.core.user.OAuth2User principal,
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities,
java.lang.String authorizedClientRegistrationId)
Constructs an
OAuth2AuthenticationToken using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAuthorizedClientRegistrationId()
Returns the registration identifier of the
Authorized
Client. |
java.lang.Object |
getCredentials() |
org.springframework.security.oauth2.core.user.OAuth2User |
getPrincipal() |
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toStringpublic OAuth2AuthenticationToken(org.springframework.security.oauth2.core.user.OAuth2User principal,
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities,
java.lang.String authorizedClientRegistrationId)
OAuth2AuthenticationToken using the provided parameters.principal - the user Principal registered with the OAuth 2.0 Providerauthorities - the authorities granted to the userauthorizedClientRegistrationId - the registration identifier of the
Authorized Clientpublic org.springframework.security.oauth2.core.user.OAuth2User getPrincipal()
public java.lang.Object getCredentials()
public java.lang.String getAuthorizedClientRegistrationId()
Authorized
Client.