Class ClientSecretAuthenticationProvider
java.lang.Object
org.springframework.security.oauth2.server.authorization.authentication.ClientSecretAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public final class ClientSecretAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
An
AuthenticationProvider implementation used for OAuth 2.0 Client
Authentication, which authenticates the client_secret parameter.- Since:
- 0.2.3
- See Also:
-
AuthenticationProviderOAuth2ClientAuthenticationTokenRegisteredClientRepositoryOAuth2AuthorizationServicePasswordEncoder
-
Constructor Summary
ConstructorsConstructorDescriptionClientSecretAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService) Constructs aClientSecretAuthenticationProviderusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) voidsetPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) Sets thePasswordEncoderused to validate theclient secret.boolean
-
Constructor Details
-
ClientSecretAuthenticationProvider
public ClientSecretAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService) Constructs aClientSecretAuthenticationProviderusing the provided parameters.- Parameters:
registeredClientRepository- the repository of registered clientsauthorizationService- the authorization service
-
-
Method Details
-
setPasswordEncoder
public void setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) Sets thePasswordEncoderused to validate theclient secret. If not set, the client secret will be compared usingPasswordEncoderFactories.createDelegatingPasswordEncoder().- Parameters:
passwordEncoder- thePasswordEncoderused to validate the client secret
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
supports
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-