mock-saml
mock-saml copied to clipboard
Add support for custom attributes
Is it possible to add support for custom attributes in the SAML response? For example, givenName, lastName, email, and so on.
This is a great idea @agiannone and also ties in with https://github.com/boxyhq/mock-saml/issues/115. Thank you.
Thanks for creating this issue @agiannone.
Wanted to also request support for custom attributes.
Currently I'm seeing the SAML response contain the following attributes:
<saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<saml:Attribute Name="id"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"
>
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>1dda9fb491dc01bd24d2423ba2f22ae561f56ddf2376b29a11c80281d21201f9</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="email"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"
>
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>[email protected]</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="firstName"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"
>
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>jackson</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="lastName"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"
>
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>jackson</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
so it looks like the firstName
and lastName
are returned, but the login form does not have fields for these values, so I guess they're just mapped to the email
form field?
Given that there are a wide range of attribute names in various systems, it'd be super handy to be able to pass in key/value pairs somewhere (.env? some yaml config?) that would be output to the saml: AttributeStatement
node.
Alternatively it'd at least be nice to have first name / last name fields in the login form : )