Skip to content
Snippets Groups Projects
Commit 0e29a1fa authored by Robin Ward's avatar Robin Ward
Browse files

Add option to retrive the `uid` from the extra info

parent d8ca81b2
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,11 @@ class SamlAuthenticator < ::Auth::OAuth2Authenticator
if auth.extra.present? && auth.extra[:raw_info].present?
result.username = auth.extra[:raw_info].attributes['screenName'].try(:first) || uid
end
if GlobalSetting.try(:saml_use_uid) && auth.extra.present? && auth.extra[:raw_info].present?
result.username = auth.extra[:raw_info].attributes['uid'].try(:first) || uid
end
result.email = auth[:info].email || uid
result.email_valid = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment