Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2016-10-19 17:50:34 +0300
committerDrew Blessing <drew@gitlab.com>2016-11-11 00:47:40 +0300
commit3cff3a2e5b87c40927eb02a8884c84260ca30c2a (patch)
treee2b9423c75157a9ad79d047a5901cb23951ec6ba /lib
parentf3231d0f634dc1e8bc9d7d69eaba1f660cd26e36 (diff)
Omniauth auto link LDAP user falls back to find by DN when user cannot be found by uid
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/o_auth/user.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb
index 0a91d3918d5..a8b4dc2a83f 100644
--- a/lib/gitlab/o_auth/user.rb
+++ b/lib/gitlab/o_auth/user.rb
@@ -102,6 +102,8 @@ module Gitlab
Gitlab::LDAP::Config.providers.each do |provider|
adapter = Gitlab::LDAP::Adapter.new(provider)
@ldap_person = Gitlab::LDAP::Person.find_by_uid(auth_hash.uid, adapter)
+ # The `uid` might actually be a DN. Try it next.
+ @ldap_person ||= Gitlab::LDAP::Person.find_by_dn(auth_hash.uid, adapter)
break if @ldap_person
end
@ldap_person