diff options
author | Drew Blessing <drew@gitlab.com> | 2016-10-19 09:50:34 -0500 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2016-11-10 15:47:40 -0600 |
commit | 3cff3a2e5b87c40927eb02a8884c84260ca30c2a (patch) | |
tree | e2b9423c75157a9ad79d047a5901cb23951ec6ba /lib | |
parent | f3231d0f634dc1e8bc9d7d69eaba1f660cd26e36 (diff) | |
download | gitlab-ce-3cff3a2e5b87c40927eb02a8884c84260ca30c2a.tar.gz |
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.rb | 2 |
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 |