Map the "displayName" Attribute in Microsoft Azure IdP to "name" Attribute in Auth0
Last Updated:
Overview
In a SAML connection, when trying to map an attribute called "displayName" that is passed from the Microsoft Azure IdP to the "name" attribute in Auth0, it is not working. Here is the mapping added to the connection.
{
"name": [
"displayName",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/displayName", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
]
}
Applies To
- SAML
- Microsoft Azure
Cause
If the http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name attribute is not mapped to something, it will always be mapped to the name attribute.
Solution
The value http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name can be mapped to something else, such as saml_name. Setting the options.fieldsMap to the following should resolve the issue:
{
"name": [
"displayName",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/displayName",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
],
"saml_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
}