Is it possible to have multiple form-login with Spring Security in the same application?

2
Well the start question may seem a bit confusing, but basically I'd like to know if it's possible to have more than one validation form of spring security:form-login , since I have two things in my system where validation will be different, ie I would have to have more than authentication-provider to perform queries on different tables.

    
asked by anonymous 05.10.2015 / 16:20

1 answer

0

Good afternoon John

It is possible to have more than one authentication provider, in fact, as many as you want in the same application.

According to the documentation, it is possible to use existing providers in Spring Security and also create your custom ones. After creation, you need to register with an authentication-manager.

Ex:

<authentication-manager>
   <authentication-provider ref="restAuthProvider/>
   <authentication-provider ref="basicAuthProvider"/>
</authentication-manager>

<bean id="restAuthProvider" class="br.com.auths.RestAuthProvider">
</bean>

<bean id="basicAuthProvider" class="br.com.auths.BasicAuthProvider">
</bean>

Ref: link

    
09.12.2015 / 21:30