teambox/omniauth-ldap — pull request #4 by saimonmoore (2014-03-26 12:58:17+00:00)
Title: Add support for multiple connections

You can now configure multiple connections like so:

use OmniAuth::Strategies::LDAP,
:title => "My LDAP",
:host => ['10.101.10.1', '10.101.10.2'],
:port => [389, 389],
:method => [:plain, :plain],
:base => ['ou=int1, dc=intridea, dc=com', 'ou=int2, dc=intridea, dc=com'],
:uid => 'sAMAccountName', # Note: Common to all connections
:name_proc => Proc.new {|name| name.gsub(/@.*$/,'')}, # Note: Common to all connections
:bind_dn => ['default_bind_dn', 'admin@intridea.com'],
# Or, alternatively:
#:filter => '(&(uid=%{username})(memberOf=cn=myapp-users,ou=groups,dc=example,dc=com))', # Note: Common to all connections
:password => ['password1', 'password2']

omniauth-ldap will then try each connection in order when trying to authenticate the user.

This feature allows you to search multiple domains/hosts, cases where bind_dn's exist in subtrees and multiple subtrees are needed.

- [X ] Rebase to `teambox` branch and reopen PR (old PR here: https://github.com/teambox/omniauth-ldap/pull/3)