BAEL-5300: add security config

This commit is contained in:
sharifi 2022-01-31 10:50:37 +03:30
parent 10dd6acd33
commit 1a70e89e1e
1 changed files with 19 additions and 0 deletions

View File

@ -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();
}
}