Java 在SpringSecurity4.0中错误太多重定向

Java 在SpringSecurity4.0中错误太多重定向,java,spring,security,spring-security,Java,Spring,Security,Spring Security,我已经为我的rest服务创建了安全性,并使用“AbstractAuthenticationProcessingFilter”使用自定义筛选器进行身份验证。以下是我的配置 <security:authentication-manager alias="authenticationManager"> <security:authentication-provider user-service-ref="personDetailsService"> <

我已经为我的rest服务创建了安全性,并使用“AbstractAuthenticationProcessingFilter”使用自定义筛选器进行身份验证。以下是我的配置

<security:authentication-manager alias="authenticationManager"> 
    <security:authentication-provider user-service-ref="personDetailsService">
     <security:password-encoder base64="true" hash="md5">  
        <security:salt-source user-property="username"/>  
      </security:password-encoder>  
    </security:authentication-provider>
</security:authentication-manager>

<security:http  entry-point-ref="restAuthenticationEntryPoint" 
        use-expressions="true" auto-config="false" create-session="stateless" >
    <security:custom-filter ref="myAppAuthenticationTokenProcessingFilter" position="FORM_LOGIN_FILTER"/>   
    <security:intercept-url pattern="/my/rest/**" access="isAuthenticated()"/>
    <security:anonymous enabled="false"/>
    <security:logout />
</security:http>
<bean class="my.web.auth.AppTokenAuthenticationFilter"
    id="myAppAuthenticationTokenProcessingFilter">
    <constructor-arg ref="requestMatcher"></constructor-arg>
</bean>

<bean class="my.web.auth.PersonDetailService"  id ="personDetailsService"></bean>

<bean class="org.springframework.security.web.util.matcher.AntPathRequestMatcher" id="requestMatcher">
 <constructor-arg type="java.lang.String" value="/my/**"></constructor-arg>

</bean>
<bean class="my.web.auth.RestAuthenticationEntryPoint" id ="restAuthenticationEntryPoint">
</bean>
</beans>

使用此配置,在调用SimpleRulAuthenticationSuccessHandler后,我的请求或继续向前过滤。甚至它在截取URL时也不能使用permitAll