Class OAuth2ClientRegistrationAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientRegistrationAuthenticationToken
- All Implemented Interfaces:
Serializable, Principal, Authentication, CredentialsContainer
An
Authentication implementation used for the OAuth 2.0 Dynamic Client
Registration Endpoint.- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractAuthenticationToken
AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>Nested classes/interfaces inherited from interface Authentication
Authentication.Builder<B> -
Constructor Summary
ConstructorsConstructorDescriptionOAuth2ClientRegistrationAuthenticationToken(@Nullable Authentication principal, OAuth2ClientRegistration clientRegistration) Constructs anOAuth2ClientRegistrationAuthenticationTokenusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns the client registration.The credentials that prove the principal is correct.@Nullable ObjectThe identity of the principal being authenticated.Methods inherited from class AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toStringMethods inherited from interface Authentication
toBuilder
-
Constructor Details
-
OAuth2ClientRegistrationAuthenticationToken
public OAuth2ClientRegistrationAuthenticationToken(@Nullable Authentication principal, OAuth2ClientRegistration clientRegistration) Constructs anOAuth2ClientRegistrationAuthenticationTokenusing the provided parameters.- Parameters:
principal- the authenticated principalclientRegistration- the client registration
-
-
Method Details
-
getPrincipal
Description copied from interface:AuthenticationThe identity of the principal being authenticated. In the case of an authentication request with username and password, this would be the username. Callers are expected to populate the principal for an authentication request.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
UserDetailsobject as the principal.- Returns:
- the
Principalbeing authenticated or the authenticated principal after authentication.
-
getCredentials
Description copied from interface:AuthenticationThe credentials that prove the principal is correct. This is usually a password, but could be anything relevant to theAuthenticationManager. Callers are expected to populate the credentials.- Returns:
- the credentials that prove the identity of the
Principal
-
getClientRegistration
Returns the client registration.- Returns:
- the client registration
-