我登录时使用spring security自定义过滤器总是重定向到错误页面

时间:2013-03-19 07:54:46

标签: spring security filter spring-security

<xmlns:s="http://www.springframework.org/schema/security"
<s:http auto-config="true" use-expressions="true">
        <s:form-login login-page="/login.action" authentication-failure-url="/login.action?error=true" authentication-success-handler-ref="authenticationSuccessHandler" login-processing-url="/securityLogin.action" />
        <s:logout logout-success-url="/" logout-url="/securityLogout.action" />
        <s:remember-me user-service-ref="userManager" key="e37f4b31-0c45-11dd-bd0b-0800200c9a66" />
        <s:custom-filter ref="customizeInterceptor" before="FILTER_SECURITY_INTERCEPTOR" />
</s:http>

<bean id="customizeInterceptor" class="com.nico.modules.security.springsecurity.CustomizeInterceptor">
        <property name="authenticationManager" ref="authenticationManager" />
        <property name="accessDecisionManager" ref="accessDecisionManager" />
    </bean>

<s:authentication-manager alias="authenticationManager">
        <s:authentication-provider user-service-ref="userManager">
            <s:password-encoder ref="passwordEncoder" />
        </s:authentication-provider>
    </s:authentication-manager>

                                                                                          

当我登录authenticationManager时可以有效,但在自定义过滤器中,对象为login.action?error= true FilterInvocation:网址:/login.action?error=true

代码:“CustomizeInterceptor”中的“securityMetadataSource”定义获取它的方法

0 个答案:

没有答案