b40ff63412
When there are no groups defined in the auth hash attributes, `Gitlab::Saml::AuthHash#groups` should return an empty array, and `Gitlab::Saml::User#find_user` should not mark the user as external. Closes gitlab-org/gitlab-ce#38923.
17 lines
383 B
Ruby
17 lines
383 B
Ruby
module Gitlab
|
|
module Saml
|
|
class AuthHash < Gitlab::OAuth::AuthHash
|
|
def groups
|
|
Array.wrap(get_raw(Gitlab::Saml::Config.groups))
|
|
end
|
|
|
|
private
|
|
|
|
def get_raw(key)
|
|
# Needs to call `all` because of https://git.io/vVo4u
|
|
# otherwise just the first value is returned
|
|
auth_hash.extra[:raw_info].all[key]
|
|
end
|
|
end
|
|
end
|
|
end
|