The discussion revolves around issues with attribute mapping using the SAML plugin in Discourse. JoreisPy is experiencing problems with incorrect data (name, email, etc.) being retrieved from their Shibboleth SSO. They suspect the issue lies with the FriendlyName not matching any options in saml_authenticator.rb.
Cgratie suggests that the actual keys needed for mapping are the ones found in the @attributes log, corresponding to the Name attribute from the XML data. They provide an example of how they successfully mapped the email attribute using the app.yml config.
Dubravko_Penezic clarifies the format for mapping multiple attributes to a Discourse variable and notes that the SAML plugin requires email, name, first_name, last_name, and uid to function properly. They also point out that the attribute_statements method in the SAML plugin code suggests that all attributes need to be mapped for the system to work correctly.
I stumbled across the same problem while testing the SAML integration and I finally managed to get it to work. With logs enabled, check the content of @attributes, those are the actual keys you need for the mapping and not the friendly name. They correspond to the Name attribute from the XML data. For my case the mapping inside app.yml became:
Probably isnt good place but just to add, you will need email, name, first_name, last_name and uid like Dicourse attribute to be able to use SAML plugin.
def attribute_statements
result = {}
statements =
"name:fullName,name|email:email,mail|first_name:first_name,firstname,firstName|last_name:last_name,lastname,lastName|nickname:screenName"
custom_statements = setting(:attribute_statements)
statements = "#{statements}|#{custom_statements}" if custom_statements.present?
statements
.split("|")
.map do |statement|
attrs = statement.split(":", 2)
next if attrs.count != 2
(result[attrs[0]] ||= []) << attrs[1].split(",")
result[attrs[0]].flatten!
end
result
end
this part of the code (have in mind I am not a Ruby programmer) suggest that you need to map all attributes to your attributes that the system may work … I will try to test that information ( I do have issue at a moment with SAML plugin and try to investigate issues).