Map the "displayName" Attribute in Microsoft Azure IdP to "name" Attribute in Auth0 Loading

Problem statement

In a SAML connection, when trying to map an attribute called “displayName” that the customer is passing 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"
  ]
}

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, e.g., saml_name, so setting 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""
}