Attributes of attributevalue element in SAML 2 Attribute Statement
- by AJ
I am building a web service that receives a SAML attribute query and responds with an attribute statement. I know I can return one or multiple values of a SAML attribute. I have some values that are dependent on the other attribute values. I need to show that relationship. Let us say, the query is for the Subject Dave and the return values are his company and job title. Dave can work at multiple companies with job title at each company.
I have two options of sending this data back:
Send this as a complextype by defining an attribute organization and return xml within that attribute.
<saml:Attribute name="company">
<saml:AttributeValue>
<company name="company1" jobtitle="CIO"/>
<company name="company2" jobtitle="VP"/>
</saml:AttributeValue>
Try to send multiple values of attributes somehow sending a reference in attributevalue element.
<saml:Attribute name="company">
<attributeValue>company1</attributeValue>
<attributeValue>company2</attributeValue>
</saml:Attribute>
<saml:Attribute name="jobTitle>
<attributeValue company="company1">CIO</attributeValue>
<attributeValue company="company2">VP</attributeValue>
</saml:Attribute>
Which approach will you prefer? Why? I am biased towards second approach as it does not require client to know about any schema. It does require them to know about non-standard attribute company in the attribute value.