Commit fdeacf0a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #6317 from jirutka/fix-ldap-dn-case

Fix searching by extern_uid for LDAP to be case-insensitive
parents 5fef5458 91e7692b
...@@ -81,8 +81,13 @@ module Gitlab ...@@ -81,8 +81,13 @@ module Gitlab
private private
def find_by_uid_and_provider
find_by_uid(uid)
end
def find_by_uid(uid) def find_by_uid(uid)
model.where(provider: provider, extern_uid: uid).last # LDAP distinguished name is case-insensitive
model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last
end end
def username def username
......
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