spring security5.0 如何才能让/**与/index.html 不冲突

2019-11-14 11:01:42 +08:00
 iszengmh

spring security5.0 如何才能让 /与 /index.html 不冲突,让所有路径需要权限,但是只开放 index.html,明明在 XML 中配置了<security:http pattern="/index.html" security="none"/>'但是在<security:http use-expression="false" entry-point-ref="ajaxAuthenticationPoint" auto-config="false"><security:intercept-url pattern="/" access="ROLE_USER"/>security:http/配置所有路径权限,导致 index 也无法访问了

1030 次点击
所在节点    程序员
1 条回复
hantsy
2019-11-14 11:12:55 +08:00
好多年没见过 XML 配置了。

按以下顺序设置试一下:

1. pattern="/**" access="ROLE_USER"
2. pattern="/index.html access 设置成匿名

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/619445

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX