【发布时间】:2020-10-09 11:53:50
【问题描述】:
我正在尝试将 permit all 授予多个 url,但我得到 403。当我禁用 csrf 时,所有请求都在没有身份验证的情况下工作。请在我的安全配置下方找到。
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()//.anyRequest().permitAll()
.antMatchers("/actuator/**","/v1/foo/link")
.permitAll()
.antMatchers("/**")
.authenticated()
.and()
.oauth2ResourceServer()
.jwt(withDefaults());
}
}
请纠正我遗漏的地方。谢谢。。
【问题讨论】:
标签: java spring-boot microservices spring-security-oauth2