Can anyone help me troubleshoot an issue where users can't log in to my application using Microsoft Azure AD through Auth0, despite following all the setup steps?

Nishtha 20 Reputation points
2024-07-19T22:25:24.0366667+00:00

I'm trying to allow users from other organizations with Microsoft Azure accounts to log in to my application. I've integrated Auth0 with Microsoft Azure AD, but it's not working as expected. The exact error message is: "The user account is not present in your tenant and therefore can't access the application. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account."

Has anyone encountered this issue or knows how to resolve it? Any help would be greatly appreciated.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,205 questions
0 comments No comments
{count} votes

Accepted answer
  1. Raja Pothuraju 4,695 Reputation points Microsoft Vendor
    2024-07-23T17:50:41.5266667+00:00

    Hello @Nishtha,

    Thank you for posting your query on Microsoft Q&A.

    Based on your description, I see you are trying to allow users from other organizations to access your application. But whenever the user accesses your application getting an error message "AADSTS50020: User account 'user@domain.com' from identity provider 'domain.com' does not exist in tenant '<your_tenant_name>' and cannot access the application '<App_ID>'(App Name) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account."

    This issue can occur if your application is registered with single-tenant support for account types. To enable users from other Microsoft Azure AD tenants to access your application with their accounts, you need to register your application with the supported account type "Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant)."

    You can make these changes to your registered application from the Authentication tab. Please refer to the screenshot below for guidance.

    User's image

    If you've already verified this solution and the issue persists, please check your application's Common Authority URLs.

    This issue typically arises when your application sends requests with a specific tenant ID. For instance, if your application is configured to support Any Microsoft Entra ID tenant - Multitenant, and you generate an access token by sending a request to https://login.microsoftonline.com/<tenant>/ authority URL, it will only authenticate users within that specific tenant. In those scenarios, users will receive an error message stating to add user as an external user in the tenant first.

    To enable sign-ins from other tenants, your application should send requests to https://login.microsoftonline.com/organizations/. Please verify whether your application is using the /organizations/ authority URL. If it is currently sending requests to https://login.microsoftonline.com/<tenant>/, you should coordinate with your application team to update the authority URL to /organizations/.

    For more details on authority URLs, you can refer to the documentation here:

    https://video2.skills-academy.com/en-us/entra/identity-platform/msal-client-application-configuration#authorityUser's image

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well. Thanks,
    Raja Pothuraju.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Babafemi Bulugbe 3,620 Reputation points MVP
    2024-07-23T06:58:34.6133333+00:00

    Hello Nisththa,

    Thank you for posting your query in the Microsoft Q&A Community.

    This error indicates that the user trying to authenticate isn't part of your organization, so they won't be able to access the application. However, I know you created a setup allowing users from other organizations to access your tenant applications.

    One important setting to check is the Supported Account types of your application. To allow users from external organizations (like other Azure AD directories) choose the appropriate multitenant option. Multitenant options include Accounts in any organizational directory (Any Entra ID directory - Multitenant).

    Also, take a look at the entire settings by strictly following the documentation from Auth0.

    Let me know if further assistance is needed.

    Babafemi

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.