catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
70 stars 132 forks source link

Allow fields with multivalued responses returned from the idp to be mapped to user profile fields (Partially resolves #346) #708

Closed mattporritt closed 1 year ago

mattporritt commented 2 years ago

Responses from the IdP can look like:

{
  "email": ["mattp@some.fake.domain"],
  "givenName": ["Matt"],
  "sn":["Porritt"],
  "choices": ["first","second","third"]
}

In the current implementation of the plugin, returned fields with multiple values only save the first value in the array into user profile fields. This patch converts fields with many values to a comma separated string. This can then be saved in a profile field.

mattporritt commented 2 years ago

ahhhh damn you old Moodle and your lack of test generators. I really want to branch the plugin because of this. But that's probably overkill