Commit 867d810d authored by Stan Hu's avatar Stan Hu

Backport CE changes for multiple GroupSAML support

This commit makes it possible for
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14420 to handle
multiple SAML providers.
parent 732ee606
...@@ -63,12 +63,20 @@ module Users ...@@ -63,12 +63,20 @@ module Users
def assign_identity def assign_identity
return unless identity_params.present? return unless identity_params.present?
identity = user.identities.find_or_create_by(provider: identity_params[:provider]) # rubocop: disable CodeReuse/ActiveRecord identity = user.identities.find_or_create_by(provider_params) # rubocop: disable CodeReuse/ActiveRecord
identity.update(identity_params) identity.update(identity_params)
end end
def identity_attributes def identity_attributes
[:provider, :extern_uid] [:provider, :extern_uid]
end end
def provider_attributes
[:provider]
end
def provider_params
identity_params.slice(*provider_attributes)
end
end end
end end
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