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:
-
AuthenticationProvider
OAuth2ClientAuthenticationToken
RegisteredClientRepository
OAuth2AuthorizationService
PasswordEncoder
-
Constructor Summary
ConstructorsConstructorDescriptionClientSecretAuthenticationProvider
(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService) Constructs aClientSecretAuthenticationProvider
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authentication
authenticate
(org.springframework.security.core.Authentication authentication) void
setPasswordEncoder
(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) Sets thePasswordEncoder
used to validate theclient secret
.boolean
-
Constructor Details
-
ClientSecretAuthenticationProvider
public ClientSecretAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService) Constructs aClientSecretAuthenticationProvider
using 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 thePasswordEncoder
used to validate theclient secret
. If not set, the client secret will be compared usingPasswordEncoderFactories.createDelegatingPasswordEncoder()
.- Parameters:
passwordEncoder
- thePasswordEncoder
used 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:
authenticate
in interfaceorg.springframework.security.authentication.AuthenticationProvider
- Throws:
org.springframework.security.core.AuthenticationException
-
supports
- Specified by:
supports
in interfaceorg.springframework.security.authentication.AuthenticationProvider
-