Onelogin - Add multiple attribute values to attribute in SAMLRESPONSE

38 views Asked by At

I am trying to add multiple attribute values to a customer SAML attribute for users in a group with OneLogin.

Currently, I can use a custom macro to check for whether a user is in a group and then set a custom attribute value.

My attribute value name is http://schemas.xmlsoap.org/claims/Group and I can set its value to my desired value giving me a SAML response attribute like this

<saml:Attribute Name="http://schemas.xmlsoap.org/claims/Group" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" >
  <saml:AttributeValue xsi:type="xs:string">example-owner</saml:AttributeValue>
</saml:Attribute>

However, when I have multiple macro rules, the attribute keeps getting overridden when a user is a member of multiple groups (e.g. owner, member, guest). I want to be able to set multiple attribute values inside the attribute like this:

<saml:Attribute Name="http://schemas.xmlsoap.org/claims/Group" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
  <saml:AttributeValue xsi:type="xs:string">example-owner</saml:AttributeValue>
  <saml:AttributeValue xsi:type="xs:string">example-member</saml:AttributeValue>
  <saml:AttributeValue xsi:type="xs:string">example-guest</saml:AttributeValue>
</saml:Attribute>

How can I achieve this in a Onelogin macro?

0

There are 0 answers