Problem statement
We are using a “Microsoft Azure AD” enterprise connection. The connection enables `Sync user profile attributes at each login". That means the Auth0 user information depends on the Microsoft account. When a user logs in with this connection, the user.name field contains the word “undefined” in the prefix e.g: “undefined John Doe”.
Cause
For Azure AD connections, user.name is a combination of given_name and family_name.
This issue will occur if you have configured the Identity API setting in my Azure AD Enterprise connection to:
- use Azure Active Directory (v1) instead of Microsoft Identity Platform (v2) and
- deleted the user’s “First name” property in the Azure Portal
Solution
There are a couple of options to remedy this:
- You could update the Identity API connection setting to Microsoft Identity Platform (v2), which is recommended. When you do this, the issue is resolved. user.name in the Auth0 profile is equal to the “Display name” property in the Azure Portal.
- Alternatively, if you have to use Azure Active Directory (v1), you could resolve this by updating the user profiles in Azure to make sure they have a “First name”.