public final class ClientSecretAuthenticationProvider
extends java.lang.Object
implements org.springframework.security.authentication.AuthenticationProvider
AuthenticationProvider implementation used for OAuth 2.0 Client Authentication,
which authenticates the client_secret parameter.AuthenticationProvider,
OAuth2ClientAuthenticationToken,
RegisteredClientRepository,
OAuth2AuthorizationService,
PasswordEncoder| Constructor and Description |
|---|
ClientSecretAuthenticationProvider(RegisteredClientRepository registeredClientRepository,
OAuth2AuthorizationService authorizationService)
Constructs a
ClientSecretAuthenticationProvider using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication) |
void |
setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
Sets the
PasswordEncoder used to validate
the client secret. |
boolean |
supports(java.lang.Class<?> authentication) |
public ClientSecretAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService)
ClientSecretAuthenticationProvider using the provided parameters.registeredClientRepository - the repository of registered clientsauthorizationService - the authorization servicepublic void setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
PasswordEncoder used to validate
the client secret.
If not set, the client secret will be compared using
PasswordEncoderFactories.createDelegatingPasswordEncoder().passwordEncoder - the PasswordEncoder used to validate the client secretpublic org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
authenticate in interface org.springframework.security.authentication.AuthenticationProviderorg.springframework.security.core.AuthenticationExceptionpublic boolean supports(java.lang.Class<?> authentication)
supports in interface org.springframework.security.authentication.AuthenticationProvider