summaryrefslogtreecommitdiff
path: root/config/initializers/devise.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-09-12 07:48:22 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-09-12 07:48:22 +0300
commit486de8c3f412df3e71c9045faf250941c03c8c00 (patch)
treed28d6700f832ad6dedbf30bbff5c9ff84ebd9210 /config/initializers/devise.rb
parent621affecb59b8ce5304370cfd7979fba2b73ff4e (diff)
downloadgitlab-ce-486de8c3f412df3e71c9045faf250941c03c8c00.tar.gz
Refactoring auth
Diffstat (limited to 'config/initializers/devise.rb')
-rw-r--r--config/initializers/devise.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 54011ba5ea3..8f3cef5a2ac 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -204,4 +204,21 @@ Devise.setup do |config|
# manager.intercept_401 = false
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
+
+ gl = Gitlab.config
+
+ if gl.ldap_enabled?
+ config.omniauth :ldap,
+ :host => gl.ldap['host'],
+ :base => gl.ldap['base'],
+ :uid => gl.ldap['uid'],
+ :port => gl.ldap['port'],
+ :method => gl.ldap['method'],
+ :bind_dn => gl.ldap['bind_dn'],
+ :password => gl.ldap['password']
+ end
+
+ gl.omniauth_providers.each do |gl_provider|
+ config.omniauth gl_provider['name'].to_sym, gl_provider['app_id'], gl_provider['app_secret']
+ end
end