在Github上发布的Spring安全示例中找到了解决方案。
WebSecurityConfigurerAdapter
有一个重载的configure
消息,该消息以WebSecurity
参数为参数,接受要忽略的请求的蚂蚁匹配器。
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/authFailure");
}
Spring Security在安全注释配置中排除URL模式
在Github上发布的Spring安全示例中找到了解决方案。
WebSecurityConfigurerAdapter
有一个重载的configure
消息,该消息以WebSecurity
参数为参数,接受要忽略的请求的蚂蚁匹配器。
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/authFailure");
}