@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{
http.authorizeHttpRequests
(auth->auth
.requestMatchers(HttpMethod.POST,"/api/v1/**").permitAll()
.requestMatchers("/users").authenticated())
.oauth2Login(Customizer.withDefaults());
return http.build();
}
Above code is applying Oauth2Login to every endpoint i want the OAuth2Login applied to only /users endpoint
is there a way to achieve this?