我想弄清楚如何使用弹簧安全OAuth2的@EnableResourceServer
,同时保持默认的春季启动的执行器安全未触及。我正在使用Spring Boot 1.5.1和依赖项的默认版本。我有以下配置弹簧启动与春季安全OAuth2和执行器
@Configuration
@EnableResourceServer
@EnableWebSecurity(debug=true)
@EnableGlobalMethodSecurity
public class OAuthConfig extends ResourceServerConfigurerAdapter {
@Override
public void configure(final HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.mvcMatchers("/resource/{type}").permitAll()
.antMatchers("/resource/data/**").authenticated();
}
}
我没有明确配置任何其他安全设置。我想想到执行器端点将继续得到适当的保护,但我得到401,并且在检查安全调试日志时,它没有显示任何关于HTTP Basic的信息。任何我做错了什么?我需要一些其他配置?
您请求什么网址?我期望.antMatchers(“//**”)。permitAll() –
farrellmr