Este es mi primer post, llevo tiempo revisando esta comunidad para resolver algunos problemas y siempre ha sido de gran ayuda, quería postear una duda para que no he podido resolver hasta el momento sobre spring security.
Debo acceder desde dos formularios distintos para validar la aplicación en este momento ya he sobreescrito las clases de spring security pertinentes para hacer la validación a mi gusto, pero cuando uso un filterchainproxy para mapear los dos accesos al ir a logar no encuentra el spring_security_check, no intercepta las url.
Dejo mi security.xml, la verdad que ahora esta un poco desastroso a base de pruebas y pruebas:
Cita:
<beans:bean id="loggerListener" class="org.springframework.security.event.authenti cation.LoggerListener" />
<http access-denied-page="/actionPub/accesoDenegado.do" auto-config="false" entry-point-ref="authenticationProcessingFilterEntryPoint">
....
...
<http-basic />
<logout invalidate-session="true"
logout-success-url="/actionPub/salir.do"
logout-url="/j_spring_security_logout" />
<concurrent-session-control max-sessions="100" exception-if-maximum-exceeded="true" expired-url="/actionPub/inicio.do"/>
</http>
<beans:bean id="authenticationProcessingFilterEntryPoint"
class="org.springframework.security.ui.webapp.Auth enticationProcessingFilterEntryPoint">
<beans:property name="loginFormUrl" value="/actionPub/verPortada.do"/>
<beans:property name="forceHttps" value="false"/>
</beans:bean>
<beans:alias name="filterChainProxy" alias="springSecurityFilterChain"/>
<beans:bean id="filterChainProxy"
class="org.springframework.security.util.FilterCha inProxy">
<filter-chain-map path-type="ant">
<filter-chain pattern="/actionPub/verPortada.do?*" filters="httpSessionContextIntegrationFilter,logou tFilter,authenticationProcessingFilterUser"/>
<filter-chain pattern="/actionPub/verPortadaNif.do?*" filters="httpSessionContextIntegrationFilter,logou tFilter,authenticationProcessingFilterNif"/>
</filter-chain-map>
</beans:bean>
<beans:bean id="logoutFilter" class="org.springframework.security.ui.logout.Logo utFilter">
<beans:constructor-arg value="/actionPub/salir.do" />
<beans:constructor-arg>
<beans:list>
<!-- <ref bean="rememberMeServices"/> -->
<beans:bean
class="org.springframework.security.ui.logout.Secu rityContextLogoutHandler" />
</beans:list>
</beans:constructor-arg>
</beans:bean>
<beans:bean id="httpSessionContextIntegrationFilter"
class="org.springframework.security.context.HttpSe ssionContextIntegrationFilter" />
<!-- <beans:bean id="AuthenticationByUserFilter" class="es.map.ipsg.security.AuthenticationByUserFi lter" >-->
<!-- <beans:property name="userService" ref="userService"/> -->
<!-- </beans:bean>-->
<beans:bean id="userServiceDetalle" class="es.map.ipsg.security.AuthenticationByDniFil ter">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="authoritiesByUsernameQuery"
value="SELECT login, authority FROM rol WHERE login=?" />
<beans:property name="authoritiesByNifQuery"
value="SELECT nif, estado, password FROM usuario WHERE nif=?" />
<!-- <custom-filter position="AUTHENTICATION_PROCESSING_FILTER"/>-->
</beans:bean>
<beans:bean id="userDetailsService" class="es.map.ipsg.security.AuthenticationByUserFi lter">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="authoritiesByUsernameQuery"
value="SELECT login, authority FROM rol WHERE login=?" />
<beans:property name="usersByUsernameQuery"
value="SELECT login, password, estado FROM usuario WHERE login=?" />
</beans:bean>
<!-- <authentication-provider user-service-ref="userDetailsService"> -->
<!-- <password-encoder hash="md5" /> -->
<!-- </authentication-provider> -->
<beans:bean id="authenticationProcessingFilterNif" class="org.springframework.security.ui.webapp.Auth enticationProcessingFilter">
<!-- <beans:property name="authenticationProcessingFilterEntryPoint" ref="authenticationProcessingFilterEntryPoint" />-->
<beans:property name="defaultTargetUrl" value="/actionPub/verPortadaNif.do" />
<beans:property name="authenticationManager" ref="authenticationManager" />
<beans:property name="filterProcessesUrl" value="/j_spring_security_check"/>
<beans:property name="authenticationFailureUrl" value="/actionPub/inicio.do?login_error=1"/>
</beans:bean>
<beans:bean id="authenticationProcessingFilterUser" class="org.springframework.security.ui.webapp.Auth enticationProcessingFilter">
<!-- <beans:property name="authenticationProcessingFilterEntryPoint" ref="authenticationProcessingFilterEntryPoint" />-->
<beans:property name="defaultTargetUrl" value="/actionPub/verPortada.do" />
<beans:property name="authenticationManager" ref="authenticationManagerUser" />
<beans:property name="filterProcessesUrl" value="/j_spring_security_check"/>
<beans:property name="authenticationFailureUrl" value="/actionPub/inicio.do?login_error=1"/>
</beans:bean>
<beans:bean id="authenticationManager" class="org.springframework.security.providers.Prov iderManager">
<beans:property name="providers">
<beans:list>
<beans:ref local="customAuthenticationProvider"/>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="authenticationManagerUser" class="org.springframework.security.providers.Prov iderManager">
<beans:property name="providers">
<beans:list>
<beans:ref local="customAuthenticationProviderUser"/>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="customAuthenticationProvider" class="es.map.ipsg.security.DaoAuthenticationProvi derImpl">
<beans:property name="userServiceDetalle" ref="userServiceDetalle"/>
<custom-authentication-provider/>
</beans:bean>
<beans:bean id="customAuthenticationProviderUser" class="es.map.ipsg.security.DaoAuthenticationProvi derUserImpl">
<beans:property name="userDetailsService" ref="userDetailsService"/>
<custom-authentication-provider/>
</beans:bean>
</beans:beans>
<http access-denied-page="/actionPub/accesoDenegado.do" auto-config="false" entry-point-ref="authenticationProcessingFilterEntryPoint">
....
...
<http-basic />
<logout invalidate-session="true"
logout-success-url="/actionPub/salir.do"
logout-url="/j_spring_security_logout" />
<concurrent-session-control max-sessions="100" exception-if-maximum-exceeded="true" expired-url="/actionPub/inicio.do"/>
</http>
<beans:bean id="authenticationProcessingFilterEntryPoint"
class="org.springframework.security.ui.webapp.Auth enticationProcessingFilterEntryPoint">
<beans:property name="loginFormUrl" value="/actionPub/verPortada.do"/>
<beans:property name="forceHttps" value="false"/>
</beans:bean>
<beans:alias name="filterChainProxy" alias="springSecurityFilterChain"/>
<beans:bean id="filterChainProxy"
class="org.springframework.security.util.FilterCha inProxy">
<filter-chain-map path-type="ant">
<filter-chain pattern="/actionPub/verPortada.do?*" filters="httpSessionContextIntegrationFilter,logou tFilter,authenticationProcessingFilterUser"/>
<filter-chain pattern="/actionPub/verPortadaNif.do?*" filters="httpSessionContextIntegrationFilter,logou tFilter,authenticationProcessingFilterNif"/>
</filter-chain-map>
</beans:bean>
<beans:bean id="logoutFilter" class="org.springframework.security.ui.logout.Logo utFilter">
<beans:constructor-arg value="/actionPub/salir.do" />
<beans:constructor-arg>
<beans:list>
<!-- <ref bean="rememberMeServices"/> -->
<beans:bean
class="org.springframework.security.ui.logout.Secu rityContextLogoutHandler" />
</beans:list>
</beans:constructor-arg>
</beans:bean>
<beans:bean id="httpSessionContextIntegrationFilter"
class="org.springframework.security.context.HttpSe ssionContextIntegrationFilter" />
<!-- <beans:bean id="AuthenticationByUserFilter" class="es.map.ipsg.security.AuthenticationByUserFi lter" >-->
<!-- <beans:property name="userService" ref="userService"/> -->
<!-- </beans:bean>-->
<beans:bean id="userServiceDetalle" class="es.map.ipsg.security.AuthenticationByDniFil ter">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="authoritiesByUsernameQuery"
value="SELECT login, authority FROM rol WHERE login=?" />
<beans:property name="authoritiesByNifQuery"
value="SELECT nif, estado, password FROM usuario WHERE nif=?" />
<!-- <custom-filter position="AUTHENTICATION_PROCESSING_FILTER"/>-->
</beans:bean>
<beans:bean id="userDetailsService" class="es.map.ipsg.security.AuthenticationByUserFi lter">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="authoritiesByUsernameQuery"
value="SELECT login, authority FROM rol WHERE login=?" />
<beans:property name="usersByUsernameQuery"
value="SELECT login, password, estado FROM usuario WHERE login=?" />
</beans:bean>
<!-- <authentication-provider user-service-ref="userDetailsService"> -->
<!-- <password-encoder hash="md5" /> -->
<!-- </authentication-provider> -->
<beans:bean id="authenticationProcessingFilterNif" class="org.springframework.security.ui.webapp.Auth enticationProcessingFilter">
<!-- <beans:property name="authenticationProcessingFilterEntryPoint" ref="authenticationProcessingFilterEntryPoint" />-->
<beans:property name="defaultTargetUrl" value="/actionPub/verPortadaNif.do" />
<beans:property name="authenticationManager" ref="authenticationManager" />
<beans:property name="filterProcessesUrl" value="/j_spring_security_check"/>
<beans:property name="authenticationFailureUrl" value="/actionPub/inicio.do?login_error=1"/>
</beans:bean>
<beans:bean id="authenticationProcessingFilterUser" class="org.springframework.security.ui.webapp.Auth enticationProcessingFilter">
<!-- <beans:property name="authenticationProcessingFilterEntryPoint" ref="authenticationProcessingFilterEntryPoint" />-->
<beans:property name="defaultTargetUrl" value="/actionPub/verPortada.do" />
<beans:property name="authenticationManager" ref="authenticationManagerUser" />
<beans:property name="filterProcessesUrl" value="/j_spring_security_check"/>
<beans:property name="authenticationFailureUrl" value="/actionPub/inicio.do?login_error=1"/>
</beans:bean>
<beans:bean id="authenticationManager" class="org.springframework.security.providers.Prov iderManager">
<beans:property name="providers">
<beans:list>
<beans:ref local="customAuthenticationProvider"/>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="authenticationManagerUser" class="org.springframework.security.providers.Prov iderManager">
<beans:property name="providers">
<beans:list>
<beans:ref local="customAuthenticationProviderUser"/>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="customAuthenticationProvider" class="es.map.ipsg.security.DaoAuthenticationProvi derImpl">
<beans:property name="userServiceDetalle" ref="userServiceDetalle"/>
<custom-authentication-provider/>
</beans:bean>
<beans:bean id="customAuthenticationProviderUser" class="es.map.ipsg.security.DaoAuthenticationProvi derUserImpl">
<beans:property name="userDetailsService" ref="userDetailsService"/>
<custom-authentication-provider/>
</beans:bean>
</beans:beans>
Gracias por la ayuda.