Nathan
Nathan

Reputation: 3

Spring Security and multiple LDAP

I have a scenario where we have to connect to multiple LDAPs, Say each one could be for different country. if a user tries to login, would have to verify whether that user is setup in any of the LDAP, so that he can be authenicated and granted access with the roles defined for that LDAP. Would it be possible with Spring security framework?

Upvotes: 0

Views: 1220

Answers (1)

Rob Winch
Rob Winch

Reputation: 21720

Yes you can authenticate against multiple LDAP servers. If you want to simply try each LDAP instance, you can do something like this:

<ldap-server id="exampleLdap" url="ldap://example.org:389/dc=springframework,dc=org" />
<ldap-server id="springLdap" url="ldap://springframework.org:389/dc=springframework,dc=org" />

<authentication-manager>
    <ldap-authentication-provider user-search-filter="(uid={0})"
       user-search-base="ou=people"
       server-ref="exampleLdap"/>
    <ldap-authentication-provider user-search-filter="(uid={0})"
       user-search-base="ou=people"
       server-ref="springLdap"/>
</authentication-manager>

Upvotes: 1

Related Questions