tngan / samlify

Node.js library for SAML SSO
https://samlify.js.org
MIT License
601 stars 214 forks source link

Return `null` instead of `[]` for empty `<AttributeValue />` #533

Open sambostock opened 5 months ago

sambostock commented 5 months ago

Sometimes a SAML server may not have a value for a particular attribute-user combination, in which case it may return an empty tag:

<saml:Attribute Name="missing" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
  <saml:AttributeValue xsi:type="xs:string" />
</saml:Attribute>

In this case, the current implementation would return [] as the value.

This changes the return value to null instead, which is what one would expect for a missing value.