@Bean
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf(csrf -> csrf.disable())
.authorizeHttpRequests(
auth -> auth.requestMatchers(HttpMethod.POST, "/api/v1/register").permitAll()
.anyRequest().authenticated())
.httpBasic(Customizer.withDefaults())
.oauth2ResourceServer(
conf -> conf.jwt(Customizer.withDefaults()));
return http.build();
}
@Bean
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf(csrf -> csrf.disable())
.authorizeHttpRequests(
auth -> auth.requestMatchers(HttpMethod.POST, "/api/v1/register").permitAll()
.anyRequest().authenticated())
.httpBasic(Customizer.withDefaults())
.oauth2ResourceServer(
conf -> conf.jwt(Customizer.withDefaults()));
return http.build();
}