SpringSecurity

57 阅读1分钟

httpSecurity 配置规则: 多配置时根据配置文件order依次套用httpsecurity规则,等效于http.and()

http.authorizeRequests() … .anyRequest()
标识全部路径适用规则 此规则之后的规则将不会生效

正确的做法: 配置A

// a下路径
http.antMatcher("/a/**").authorizeRequests()....anyRequest()

配置B

// b下路径
http.antMatcher("/b/**").authorizeRequests()....anyRequest()

配置C

// 其他
http.authorizeRequests()....anyRequest()