Detect multiple study programmes
Currently it seems we only process the first study programme that is sent from SSO. Instead we should process also multiple programmes.
Decoding a SAML response shows that there are sometimes multiple values sent for the study programme attribute:
<saml:Attribute Name="nlEduPersonStudyBranch" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xsi:type="xs:string">B Werktuigbouwkunde</saml:AttributeValue>
<saml:AttributeValue xsi:type="xs:string">B Technische Informatica</saml:AttributeValue>
</saml:Attribute>
Unfortunately, it seems like Devise SAML only gives us the first attribute value: https://github.com/apokalipto/devise_saml_authenticatable/blob/master/lib/devise_saml_authenticatable/saml_mapped_attributes.rb
There is an issue about it, and even a pull request: https://github.com/apokalipto/devise_saml_authenticatable/issues/61 https://github.com/apokalipto/devise_saml_authenticatable/pull/159
It seems to me that overriding the definition of lib/devise_saml_authenticatable/saml_mapped_attributes.rb with the newer version should allow us to specify multi-value properties, and then handle them. Or at the very least to make an implementation of a saml mapper that handles both types correctly.