AADSTS50020: User account 'example@example.com' from identity provider 'live.com' does not exist in tenant 'Default Directory' and cannot access the application '' in that tenant.

Oliver Moscow 20 Reputation points
2024-03-24T23:34:39.35+00:00

Hello,

I am trying to integrate sign-in with Azure-ad using Next Auth. I followed all of the instructions in https://next-auth.js.org/providers/azure-ad and created a new application with the signInAudience set to AzureADandPersonalMicrosoftAccount. However, I am getting the following error when I try to login with my personal Microsoft account:

AADSTS50020: User account 'example@example.com' from identity provider 'live.com' does not exist in tenant 'Default Directory' and cannot access the application '123ba67-123a-1b34-1a34-123abc456'(example) 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.

I have looked at the Microsoft documentation on this issue https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/error-code-aadsts50020-user-account-identity-provider-does-not-exist but none of the solutions mentioned in the article fixed this issue.

Any ideas on what I could be missing here?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,641 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,475 questions
0 comments No comments
{count} votes

Accepted answer
  1. Babafemi Bulugbe 1,710 Reputation points
    2024-03-24T23:53:52.3533333+00:00

    Hello Oliver Moscow

    Thank you for contacting the Microsoft community Q&A support.

    You are experiencing this issue because the user account you are trying to authenticate with doesn't exist in the tenant where you created the application.

    From the error above, you are trying to authenticate with a personal account (live account) that doesn't exist in the tenant. You have to invite the user account to the tenant where you created the app registration by inviting the user account as a guest.

    Screenshot of the invite external user menu option.

    Follow this link for more information https://learn.microsoft.com/en-us/entra/external-id/b2b-quickstart-add-guest-users-portal

    You can create a work account in the tenant and authenticate with this user.

    Let me know if further assistance is needed.

    Babafemi


0 additional answers

Sort by: Most helpful