【发布时间】:2015-06-02 09:37:00
【问题描述】:
我有一个应用程序,我只需要保护 /admin/ 页面。所有其他页面都没有登录、帐户或其他需要安全性的功能。
根据其他问题和教程,我目前已经通过明确忽略所有不需要安全性的路径来实现这一点,例如
web
.ignoring()
.antMatchers("/js/**");
web
.ignoring()
.antMatchers("/static/**");
web
.ignoring()
.antMatchers("/images/**");
web
.ignoring()
.antMatchers("/css/**");
web
.ignoring()
.antMatchers("/fonts/**");
这会使配置变得更大,并且不完全清楚您要保护的内容,因为它只说明了例外情况。
有没有办法先明确禁用所有安全性,然后添加要激活的模式?
【问题讨论】:
标签: spring-security