public class OAuth2UserAuthenticationToken extends AbstractAuthenticationToken
AbstractAuthenticationToken
that represents an OAuth 2.0 User Authentication.
This Authentication associates an OAuth2User principal to a
OAuth2ClientAuthenticationToken which represents the "Authorized Client".
OAuth2User,
OAuth2ClientAuthenticationToken,
Serialized Form| Constructor and Description |
|---|
OAuth2UserAuthenticationToken(OAuth2ClientAuthenticationToken clientAuthentication) |
OAuth2UserAuthenticationToken(OAuth2User principal,
java.util.Collection<? extends GrantedAuthority> authorities,
OAuth2ClientAuthenticationToken clientAuthentication) |
| Modifier and Type | Method and Description |
|---|---|
OAuth2ClientAuthenticationToken |
getClientAuthentication() |
java.lang.Object |
getCredentials()
The credentials that prove the principal is correct.
|
java.lang.Object |
getPrincipal()
The identity of the principal being authenticated.
|
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toStringpublic OAuth2UserAuthenticationToken(OAuth2ClientAuthenticationToken clientAuthentication)
public OAuth2UserAuthenticationToken(OAuth2User principal, java.util.Collection<? extends GrantedAuthority> authorities, OAuth2ClientAuthenticationToken clientAuthentication)
public java.lang.Object getPrincipal()
Authentication
The AuthenticationManager implementation will often return an
Authentication containing richer information as the principal for use by
the application. Many of the authentication providers will create a
UserDetails object as the principal.
Principal being authenticated or the authenticated
principal after authentication.public java.lang.Object getCredentials()
AuthenticationAuthenticationManager. Callers
are expected to populate the credentials.Principalpublic OAuth2ClientAuthenticationToken getClientAuthentication()