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

Asked

Viewed 96 times

2

Well the starting question may seem a little confusing, but basically I would like to know if it is possible to have more than one spring validation form security:form-login, because I have in my system two points in which the validation will be different, ie I would have to have more than one authentication-provider to perform the queries in different tables.

1 answer

0

Good afternoon João

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 their customized ones. After creation, you need to register in 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: http://docs.spring.io/spring-security/site/docs/4.0.3.RELEASE/reference/htmlsingle/#ns-auth-manager

Browser other questions tagged

You are not signed in. Login or sign up in order to post.