Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class OAuth2AuthenticationToken
- Object
- AbstractAuthenticationToken
- OAuth2AuthenticationToken
ImplementsAuthentication
A user who signed in through an identity provider.
This is the authentication of the request that completed the sign-in. The
session keeps who signed in – the name and the authorities – and the
requests that follow see those, with the provider’s id and the user’s
attributes in getDetails() as a map.
Constructors
public OAuth2AuthenticationToken(OAuth2User principal, Collection<? extends GrantedAuthority> authorities, String authorizedClientRegistrationId) |
Methods
public OAuth2User getPrincipal() | The identity: a username before authentication, and afterwards usually the UserDetails it was resolved to. |
public Object getCredentials() | What proves the principal is who it says: a password, usually, and null once it has been checked. |
public String getName() | The principal’s name. |
public String getAuthorizedClientRegistrationId() | The registration the user signed in through. |
Inherited methods
Constructor details
OAuth2AuthenticationToken
public OAuth2AuthenticationToken(OAuth2User principal, Collection<? extends GrantedAuthority> authorities, String authorizedClientRegistrationId)Method details
getPrincipal
public OAuth2User getPrincipal()The identity: a username before authentication, and afterwards usually the
UserDetails it was
resolved to.getCredentials
public Object getCredentials()What proves the principal is who it says: a password, usually, and null
once it has been checked.
getName
public String getName()The principal’s name.
getAuthorizedClientRegistrationId
public String getAuthorizedClientRegistrationId()The registration the user signed in through.