diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb index 0a91d3918d553baaa0ef6bdb7f48b65651ac824e..e4e6f36613f6cb091373cca8c30bba3c68703031 100644 --- a/lib/gitlab/o_auth/user.rb +++ b/lib/gitlab/o_auth/user.rb @@ -102,6 +102,10 @@ def ldap_person 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. + unless @ldap_person + @ldap_person = Gitlab::LDAP::Person.find_by_dn(auth_hash.uid, adapter) + end break if @ldap_person end @ldap_person