commodo/omniauth-ldap — pull request #2 by commodo (2014-01-07 08:20:29+00:00)
Title: Added support for authenticating the same username in different subdomains

[Note that this is related to pull request : https://github.com/intridea/omniauth-ldap/pull/39 ]

In case you have a company domain like DC=example,DC=com
And you have multiple subdomains (US, EMEA, AU, etc), and the (company) policy is to define the same username in all subdomains (example user1), then there is a problem when it comes to authenticating user1.

So, a quick fix is to add a user format like subdomain\username, for example

* us\user1 would authenticate on DC=us,DC=example,DC=com
* emea\user1 would authenticate on DC=emea,DC=example,DC=com
* and so on

All you have to do, is to add your base DN as DC=example,DC=com and whenever a user tries to login, he can use the subdomain as a prefix.
This is only needed when the the same username is present in more subdomains.
Otherwise, this works as before.