SpringSecurity过滤路径的问题

无爱大叔 2021-01-15 08:36:56
一个网站项目采用了springsecurity和thymeleaf
网站首页地址为:http://localhost/index
网站后台地址为:http://localhost/login

直接访问http://localhost/index和后台地址没问题,当访问类似http://localhost/index?xxid=udi932akkdz==&token=3990201993331这样的url时会跳到http://localhost/login登录页,这里(外部)传入的xxid和token我在网站里是不用做任何处理的

SpringSecurity过滤路径我是放在这里的
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("不需要认证的资源路径").permitAll();
}
上面这个地方应该怎么写才能同时放行/index和/index?xxid=xxx&token=xxx
...全文
663 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
醉纳 2021-01-20
  • 打赏
  • 举报
回复
configure方法中,直接WebSecurity web.ignoring().antMatchers("需要忽略安全拦截的URL");

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧