Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/auth/saml/config.rb')
-rw-r--r--lib/gitlab/auth/saml/config.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gitlab/auth/saml/config.rb b/lib/gitlab/auth/saml/config.rb
index 7524d8b9f85..e6c9f04eff5 100644
--- a/lib/gitlab/auth/saml/config.rb
+++ b/lib/gitlab/auth/saml/config.rb
@@ -8,6 +8,21 @@ module Gitlab
def enabled?
::AuthHelper.saml_providers.any?
end
+
+ def default_attribute_statements
+ defaults = OmniAuth::Strategies::SAML.default_options[:attribute_statements].to_hash.deep_symbolize_keys
+ defaults[:nickname] = %w[username nickname]
+ defaults[:name] << 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'
+ defaults[:name] << 'http://schemas.microsoft.com/ws/2008/06/identity/claims/name'
+ defaults[:email] << 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'
+ defaults[:email] << 'http://schemas.microsoft.com/ws/2008/06/identity/claims/emailaddress'
+ defaults[:first_name] << 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'
+ defaults[:first_name] << 'http://schemas.microsoft.com/ws/2008/06/identity/claims/givenname'
+ defaults[:last_name] << 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname'
+ defaults[:last_name] << 'http://schemas.microsoft.com/ws/2008/06/identity/claims/surname'
+
+ defaults
+ end
end
DEFAULT_PROVIDER_NAME = 'saml'