为什么在 Spring 安全性中我需要拦截-url?
Why in Spring Security I need the intercept-url?
我正在研究 Spring 安全性,我对其配置有疑问。
所以我知道在 Spring 配置文件中我需要这样的东西:
<beans>
<security:http>
<security:intercept-url pattern="/accounts/**" access="IS_AUTHENTICATED_FULLY" />
<security:form-login login-page="/login.htm"/>
<security:logout logout-success-url="/index.html"/>
</security:http>
</beans>
所以我的疑问是:为什么我需要拦截-url?它是否仅与指定我需要确保安全的特定 URL 有关?你能给我更准确的信息吗?
Tnx
是的,使用 intercept-url,您指定必须保护的 urls,以及访问类型(如必要的角色等)。您可以在文档中找到更多相关信息:http://docs.spring.io/spring-security/site/docs/3.0.x/reference/el-access.html
我正在研究 Spring 安全性,我对其配置有疑问。
所以我知道在 Spring 配置文件中我需要这样的东西:
<beans>
<security:http>
<security:intercept-url pattern="/accounts/**" access="IS_AUTHENTICATED_FULLY" />
<security:form-login login-page="/login.htm"/>
<security:logout logout-success-url="/index.html"/>
</security:http>
</beans>
所以我的疑问是:为什么我需要拦截-url?它是否仅与指定我需要确保安全的特定 URL 有关?你能给我更准确的信息吗?
Tnx
是的,使用 intercept-url,您指定必须保护的 urls,以及访问类型(如必要的角色等)。您可以在文档中找到更多相关信息:http://docs.spring.io/spring-security/site/docs/3.0.x/reference/el-access.html