title: LDAP Authentication in Sping with multiple URLs
body: <p>I have an application that uses <strong>LDAP Spring</strong> for authentication which works as expected.
  Now we are trying to support providing <strong>multiple URLs</strong> to authenticate on and I found that this is already supported to some extent in the sense that I can pass a space-separated list of LDAP URLs and Spring will know what to do with that.</p>
  <p>Let's say that the servers are:</p>
  <ol>
  <li>ldap://server1:389</li>
  <li>ldap://server2:389</li>
  </ol>
  <p>My yml file with the URL has: &quot;ldap://server1:389 ldap://server2:389&quot; as its value.</p>
  <p>Now, the problem is that if a user from server2 tries to log in, it will fail as Spring is trying to find it on server1 and because it does not exist there I get a BadCredentials error.</p>
  <p>My expectation would be that if it fails to login (due to bad credentials error, for example) on the first server, then it should try on the second one, and so on, on any number of supplied LDAP URLs.</p>
  <p>If server1 fails to connect, then it successfully authenticates the user on server2 as the user only exists there.</p>
  <p>From the research I did, I could not find anything specific to understand if this is the expected behavior or if there is any way to get this behavior without custom implementation.</p>
  <p>I know that I can achieve this by writing custom code to try each server one by one but I was wondering if there is any way to achieve this already.</p>
  <p>.</p>
  <p><strong>In Summary:</strong> Can I authenticate into different LDAP URLs with the users that only exist on one or the other server but not in both?
  I'm not looking for a failover scenario but for a scenario where a user from server2 can log in even if server1 is also running correctly.</p>
  <p>.</p>
  <p><em>I'm using spring-security-ldap-5.3.3.RELEASE.</em></p>