环境:Spring 3.1.3 Spring安全性:3.1.3 Spring ldap:1.3.1 JDK1.6
问题:我的登录处理网址上有404 .
详细信息:我有三个http拦截块:一个公共拦截块,第二个用于拦截和保护管理员的URL(使用身份验证管理器1),第三个用于常规用户(使用身份验证管理器2) .
当http拦截块1中的登录表单将凭证发布到表单登录的login-processing-url时,它会产生404.我确实得到了这个 - 因为表单登录宣布登录处理url,不应该过滤链识别该URL?
另外,shluld我在表单的login-processing-url上明确地做了“permitAll”,还是在封面下自动完成?
最后,让不同的http拦截器块具有不同的login-processing-urls是否有问题? (我不明白为什么 - 但我还是会问) .
配置:
Spring安全配置:
//...
<debug />
<global-method-security secured-annotations="enabled" />
<http pattern="/public/**" security="none"/>
<http use-expressions="true" pattern="/protected/x/support/**" authentication-manager-ref="lAdminAuthManager">
<intercept-url pattern="/protected/x/support/**" access="hasRole('ROLE_ADMIN')"/>
<form-login login-page="/public/login.jsp"
login-processing-url="/protected/x/support/j_spring_security_check"
username-parameter="username"
password-parameter="password"
authentication-failure-url="/login/form?error"
default-target-url="/protected/x/support/index.html"/>
</http>
<http use-expressions="true" entry-point-ref="lUserLoginEntryPoint">
<intercept-url pattern="/protected/x/foo1/**" access="permitAll"/>
<intercept-url pattern="/protected/x/foo2/**" access="permitAll"/>
<intercept-url pattern="/j_spring_security_check" access="permitAll"/>
<intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
<custom-filter ref="lUserLoginFilter" position="FORM_LOGIN_FILTER"/>
<custom-filter ref="lPreauthAuthenticationFilter" position="PRE_AUTH_FILTER" />
</http>
//...
任何提示非常感谢!
感谢名单,
乌玛
1 回答
任何方式检查以下链接 . 它可能会帮助你
访问http://krams915.blogspot.com/2010/12/spring-security-mvc-integration_18.html
http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity.html
Even a small url conflict in config files will cause 404 error.