Commit 91e7692b66f8916f634af6cf1d2dc1a459699733
1 parent
5e935bfe
Exists in
spb-stable
and in
3 other branches
Fix searching by extern_uid for LDAP to be case-insensitive
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
lib/gitlab/ldap/user.rb
... | ... | @@ -83,8 +83,13 @@ module Gitlab |
83 | 83 | |
84 | 84 | private |
85 | 85 | |
86 | + def find_by_uid_and_provider | |
87 | + find_by_uid(uid) | |
88 | + end | |
89 | + | |
86 | 90 | def find_by_uid(uid) |
87 | - model.where(provider: provider, extern_uid: uid).last | |
91 | + # LDAP distinguished name is case-insensitive | |
92 | + model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last | |
88 | 93 | end |
89 | 94 | |
90 | 95 | def provider | ... | ... |