I created the azure AD enterprise connection according to auth0’s docs.
As i’m testing this connection, I see that the users created have no email at all, the closest there is the ‘upn’ attribute in the json part of the users which holds the email.
I don’t want to resort to updating the email via auth0 api, something could be blocking auth0 from getting the email, or auth0 is configured not to take the email, not sure which…
In Azure AD you have two separate claims, the upn and the email.
Have you added email in the “Token Configuration” section in the Azure AD Portal.
It can be added as the optional claims(to the ID token) in the “Token Configuration” section
I am only seeing this problem occur on Azure Active Directory accounts that are using custom domains. Default Microsoft *.onmicrosoft.com seem to set the email address correctly without even adding optional claims to the ID token (or enabling “Extended Profile” in the Azure AD connection in Auth0)
It looks we need to use the auth-pipeline rules to add an email to the access token even though if you do this the backend (we use .net) will fail the token validation.
I had the same problem: when logging with Azure AD, Auth0 was not able to retrieve / store the email (but the UPN was).
I finally realize that the user I used to perform login tests had no email property on Azure side. So I added one (the same as the UPN in my case) via the Microsoft Entra ID dashboard (Users > {the user you want to edit} > Properties > Edit “Contact information” > Save with an email).
I had the same issue. I tried using the tenant ID instead of the custom domain, as I have another configuration with a different tenant that works with the tenant ID without needing to specify any optional claims on the AD side or requesting extended profile. however none of it worked for this tenant, so I changed the Identity API from V2 to V1 and that solved the issue for me.
We’ve updated our Knowledge Solutions with a chapter about Adding Claims with Action in a similar fashion to how Rules worked. You can find it here → Azure AD Integration not Providing the User Email