JAVA-27656 | removing WebSecurityConfigurerAdapter
This commit is contained in:
parent
8dd4651db5
commit
4151b9ce70
|
@ -1,19 +1,23 @@
|
||||||
package com.baeldung.cloud.openfeign.oauthfeign;
|
package com.baeldung.cloud.openfeign.oauthfeign;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
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
|
@Configuration
|
||||||
public class OAuth2WebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
|
public class OAuth2WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
@Override
|
@Bean
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||||
http
|
http
|
||||||
.csrf()
|
.csrf()
|
||||||
.disable()
|
.disable()
|
||||||
.oauth2Client();
|
.oauth2Client();
|
||||||
|
|
||||||
http
|
http
|
||||||
.authorizeRequests().anyRequest().permitAll();
|
.authorizeRequests().anyRequest().permitAll();
|
||||||
|
|
||||||
|
return http.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue