Add support for multiple ldap omniauth strategies

parent cd1d5b20
module OmniAuth::Strategies
class Ldap0 < LDAP; end
class Ldap1 < LDAP; end
class Ldap2 < LDAP; end
class Ldap3 < LDAP; end
class Ldap4 < LDAP; end
class Ldap5 < LDAP; end
end
\ No newline at end of file
...@@ -211,16 +211,18 @@ Devise.setup do |config| ...@@ -211,16 +211,18 @@ Devise.setup do |config|
email_stripping_proc = ->(name) {name} email_stripping_proc = ->(name) {name}
end end
config.omniauth :ldap, Gitlab.config.ldap.servers.each_with_index do |server, i|
host: Gitlab.config.ldap['host'], config.omniauth :"ldap#{i}",
base: Gitlab.config.ldap['base'], host: server['host'],
uid: Gitlab.config.ldap['uid'], base: server['base'],
port: Gitlab.config.ldap['port'], uid: server['uid'],
method: Gitlab.config.ldap['method'], port: server['port'],
bind_dn: Gitlab.config.ldap['bind_dn'], method: server['method'],
password: Gitlab.config.ldap['password'], bind_dn: server['bind_dn'],
password: server['password'],
name_proc: email_stripping_proc name_proc: email_stripping_proc
end end
end
Gitlab.config.omniauth.providers.each do |provider| Gitlab.config.omniauth.providers.each do |provider|
provider_arguments = [] provider_arguments = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment