title: Apache shiro LDAP multiple OUs
body: <p>I am trying to configure apache shiro to authenticate using our LDAP server. I am not very familiar with LDAP so forgive my ignorance please!</p>
  
  <p>Using the following option in shiro.ini is working ok (users are authenticated):</p>
  
  <pre>
  ldapRealm.userDnTemplate = uid={0},ou=users,dc=mycompany,dc=com
  </pre>
  
  <p>However we have more than one organization unit (ou) in our company. How can I make the ou parameter take multiple values ? Can I use something this </p>
  
  <pre>
  ldapRealm.userDnTemplate = uid={0},ou=*,dc=mycompany,dc=com
  </pre>
  
  <p>I just want to try all organization units until the login is successfull.</p>
  
  <p>What about adding extra ldap realms having different ou like this:</p>
  
  <pre>
  #ldapRealm1
  ldapRealm1 = org.apache.shiro.realm.ldap.JndiLdapRealm
  ldapRealm1.userDnTemplate = uid={0},ou=users1,dc=mycompany,dc=com
  ldapRealm1.contextFactory.url = ldap://test.com:389
  #ldapRealm2
  ldapRealm2 = org.apache.shiro.realm.ldap.JndiLdapRealm
  ldapRealm2.userDnTemplate = uid={0},ou=users2,dc=mycompany,dc=com
  ldapRealm2.contextFactory.url = ldap://test.com:389
  #ldapRealm3
  ldapRealm3 = org.apache.shiro.realm.ldap.JndiLdapRealm
  ldapRealm3.userDnTemplate = uid={0},ou=users3,dc=mycompany,dc=com
  ldapRealm3.contextFactory.url = ldap://test.com:389
  </pre>
  
  <p>Will this work ?</p>
  
  <p>Also is it possible to add a dropdown in the login page to allow the users select their organization unit and pass it as a paremeter to the ldapRealm ? How should I proceed with that ? </p>
  
  <p>TIA,
  Serafeim</p>