在Spring Security中不是配置了user放行了吗,请求的时候为什么还要带token?
来源:3-8 读取Redis登录用户信息和清空Redis用户信息
三尺357159
2022-05-21
@Override
public void configure(HttpSecurity http) throws Exception {
// 配置放行的资源
http.authorizeRequests()
.anyRequest()
.authenticated()
.and()
.requestMatchers()
.antMatchers("/user/**");
}
请求user/me的时候,还需要带有access_token参数呢,跟authentication这个有关吗?
@GetMapping("user/me")
public ResultInfo getCurrentUser(Authentication authentication){...}
写回答
1回答
-
InCowboy
2022-05-25
.antMatchers("/user/**")这个方法只是匹配到了user开头的url地址,访问权限校验还是在.authorizeRequests()这个方法下进行的
00
相似问题