【发布时间】:2015-12-10 13:14:23
【问题描述】:
我已经通过使用 intecept-url 为我的项目配置了一个 spring 安全上下文,我能够验证所有 URL,但是当我通过 URL 传递一些 ID 时,验证不会发生。
<intercept-url pattern="/**" access="isAuthenticated()"/>
工作网址
http://localhost:8080/WEB/add-employee
http://localhost:8080/WEB/view-employee
网址无效
http://localhost:8080/WEB/edit-employee/1
http://localhost:8080/WEB/edit-employee/2
1 和 2 是通过 URL 传递的 ID,上述 URL 模式不起作用(这意味着当我通过 URL 传递 ID 时)
我在拦截 URL 中尝试了许多组合,但我没有得到正确的结果。
<http use-expressions="true">
<intercept-url pattern="/**" access="isAuthenticated()"/> <!-- this means all URL in this app will be checked if user is authenticated -->
<!-- We will just use the built-in form login page in Spring -->
<form-login login-page="/" login-processing-url="/j_spring_security_check" default-target-url="/home" authentication-failure-url="/"/>
<logout logout-url="/logout" logout-success-url="/"/> <!-- the logout url we will use in JSP -->
</http>
【问题讨论】:
标签: spring spring-security spring-security-oauth2