JAVA-27656 | removing WebSecurityConfigurerAdapter

This commit is contained in:
gaepi 2023-11-27 12:00:26 +01:00
parent 8dd4651db5
commit 4151b9ce70
1 changed files with 8 additions and 4 deletions

View File

@ -1,19 +1,23 @@
package com.baeldung.cloud.openfeign.oauthfeign;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.SecurityFilterChain;
@Configuration
public class OAuth2WebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
public class OAuth2WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.oauth2Client();
http
.authorizeRequests().anyRequest().permitAll();
return http.build();
}
}