【发布时间】:2020-07-10 00:12:56
【问题描述】:
我一直在阅读来自 here 的 spring 安全文档。 有一个例子:
@Configuration
@Order(SecurityProperties.BASIC_AUTH_ORDER - 10)
public class ApplicationConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.antMatcher("/foo/**")
.authorizeRequests()
.antMatchers("/foo/bar").hasRole("BAR")
.antMatchers("/foo/spam").hasRole("SPAM")
.anyRequest().isAuthenticated();
}
}
它说
配置 Spring Security 最容易犯的错误之一就是忘记了这些匹配器适用于不同的进程,一个是整个过滤器链的请求匹配器,另一种只是选择要应用的访问规则。
我想知道这是什么忘记?我无法获得关系、过滤器链和请求匹配器
【问题讨论】:
标签: spring authentication spring-security