BAEL-5300: add security config
This commit is contained in:
parent
10dd6acd33
commit
1a70e89e1e
|
@ -0,0 +1,19 @@
|
||||||
|
package com.baeldung.cloud.openfeign.oauthfeign;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class OAuth2WebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
|
http
|
||||||
|
.csrf()
|
||||||
|
.disable()
|
||||||
|
.oauth2Client();
|
||||||
|
http
|
||||||
|
.authorizeRequests().anyRequest().permitAll();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue