In Spring Oauth2 Authorization Server i want to customize ClientSecretAuthenticationProvider
when generate token api is trigger. But unfortunately the CustomClientSecretAuthenticationProvider
is not being executed its still using the default ClientSecretAuthenticationProvider
. Would like to know how to fix this.
link: https://github.com/spring-projects/spring-authorization-server/blob/1.2.x/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/ClientSecretAuthenticationProvider.java
@Bean
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
OAuth2AuthorizationServerConfigurer authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer();
authorizationServerConfigurer
.tokenEndpoint(token -> {
token.authenticationProvider(new CustomClientSecretAuthenticationProvider(registeredClientRepository,jdbcOAuth2AuthorizationService()));
});