0

I have two kingdoms security and each refferencio one AuthenticationManager different with authentication-manager-ref, also each specific http cabeceera the pattern = "/", but when I run and try to log into each Report form me get the error:

09.16.2014 17:03:25 DEBUG FilterChainProxy: 180 - / j_spring_security_check has not matching filters 
09.16.2014 17:03:25 DEBUG DispatcherServlet: 819 - DispatcherServlet with name 'dispatcher' processing POST request for [/ testholding / j_spring_security_check] 
09.16.2014 17:03:25 DEBUG RequestMappingHandlerMapping: 209 - Looking up handler method for path / j_spring_security_check 
09.16.2014 17:03:25 DEBUG RequestMappingHandlerMapping: 219 - Did not find handler method for [/ j_spring_security_check] 
09.16.2014 17:03:25 DEBUG SimpleUrlHandlerMapping: 169 - Matching patterns for request [/ j_spring_security_check] are [/ **] 
09.16.2014 17:03:25 DEBUG SimpleUrlHandlerMapping: 193 - URI Template variables for request [/ j_spring_security_check] are {} 
09.16.2014 17:03:25 DEBUG SimpleUrlHandlerMapping: 124 - Mapping [/ j_spring_security_check] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler@1477b3e] and 1 interceptor 
09.16.2014 17:03:25 DEBUG DispatcherServlet: 957 - Null ModelAndView returned to DispatcherServlet with name 'dispatcher': Assuming HandlerAdapter completed request handling 
09.16.2014 17:03:25 DEBUG DispatcherServlet: 913 - Successfully completed request

My spring-security.xml:

<!-- REINO DE SEGURIDAD USUARIO WEB SERVICE UNIVERSIA -->

    <http auto-config="false"
    use-expressions="true" pattern="/testUser/**" authentication-manager-ref="authenticationManager" >

        <intercept-url pattern="/testUser/**" access="hasRole('ROLE_USER')" />
        <intercept-url pattern="/j_spring_security_check" access="permitAll"/>
        <access-denied-handler error-page="/403" />
          <form-login login-page="/loginUser.html" 
            authentication-failure-url="/loginUser.html?login_error=true"
            default-target-url="/testUser" 
            username-parameter="j_username" password-parameter="j_password" />

        <!--<custom-filter position="FORM_LOGIN_FILTER" ref="userAuthenticationProcessingFilter" />-->
        <logout invalidate-session="true" logout-success-url="/loginUser.html"  />

    </http>



    <!--REINO DE SEGURIDAD ACCESO ADMINISTRADOR POR BASE DE DATOS -->

    <http auto-config="true" use-expressions="true" pattern="/test/**" authentication-manager-ref="DBauthenticationManager">
        <intercept-url pattern="/test/**" access="hasRole('ROLE_ADMIN')" />
        <intercept-url pattern="/testUser/**" access="hasRole('ROLE_ADMIN')" />
        <intercept-url pattern="/member/**" access="hasRole('ROLE_EMPLOYEES')" />

        <access-denied-handler error-page="/403" />
        <form-login login-page="/login.html"
            authentication-failure-url="/login.html?login_error=true"
            username-parameter="j_username" password-parameter="j_password" />

        <logout invalidate-session="true" logout-success-url="/loginUser.html" />

    </http>


    <beans:bean id="md5PasswordEncoder"
        class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" />

     <beans:bean id="customUserDetailsService"
        class="net.universia.test.autenticacionService.CustomUserDetailsService" />

    <!-- Acceso contra base de datos -->
    <authentication-manager alias="DBauthenticationManager" id="DBauthenticationManager">
        <authentication-provider user-service-ref="customUserDetailsService">
            <password-encoder hash="md5" />
        </authentication-provider>
    </authentication-manager>

 <beans:bean id="customAuthenticationProvider"
        class="net.universia.test.autenticacionService.CustomAuthenticationProvider" />

 <!-- Acceso por WS -->
  <authentication-manager id="authenticationManager" alias="authenticationManager">
     <authentication-provider ref="customAuthenticationProvider" />
    </authentication-manager>

My web.xml:

<filter>
       <filter-name>springSecurityFilterChain</filter-name>
       <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
       <filter-name>springSecurityFilterChain</filter-name>
       <url-pattern>/*</url-pattern>
        <dispatcher > ERROR </dispatcher >
         <dispatcher > REQUEST </dispatcher >
         <dispatcher > INCLUDE </dispatcher >
         <dispatcher > FORWARD </dispatcher >
    </filter-mapping>

Help me please!

1 Answers1

0

Solve the problem Just implement a /user/j_spring_security_check and /admin/ j_spring_security_check and call on login-processing-url="" and the action="" of each form jsp