mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-17 16:46:06 +10:00
Make authentication backwards compatible with multiple LDAP servers
Note: authentication agains an other server, other then the first still does not work. This will be completed in further MR's
This commit is contained in:
@@ -45,11 +45,16 @@ module Gitlab
|
||||
|
||||
def find_by_uid(uid)
|
||||
# LDAP distinguished name is case-insensitive
|
||||
model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last
|
||||
model.
|
||||
where(provider: [provider, :ldap]).
|
||||
where('lower(extern_uid) = ?', uid.downcase).last
|
||||
end
|
||||
|
||||
def provider
|
||||
'ldap'
|
||||
# Note: for backwards compatibility we just get the first provider
|
||||
# Later on, we should loop through all servers until a successful
|
||||
# authentication
|
||||
Gitlab::LDAP::Config.servers.first.provider_name
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user