HI @Anil Reddy
I understand you're encountering the error AADSTS50020: User account does not exist in tenant when trying to access the application using personal accounts.
This error can occur in several scenarios. Please review the steps below to troubleshoot:
1.Check the app registration's supported account type If your app registration is set to single-tenant, users from other directories or identity providers will not be able to sign in. Ensure the app registration is configured as multi-tenant if you want to allow external users.
2.Use the correct authentication endpoint If you're using https://login.microsoftonline.com/<YourTenantNameOrID>
, only users from that tenant can access the app. For multi-tenant apps or apps that support personal Microsoft accounts, use the common endpoint: https://login.microsoftonline.com/common
3.Check if the app requires user assignment If your enterprise application requires user assignment, users not explicitly assigned will receive the AADSTS50020 error. Make sure users are assigned access to the application either individually or via a group.
4.Ensure the user is signed into the correct tenant/account Users might access the app via a direct link or through https://myapps.microsoft.com. In some cases, users may have an active session with a different account than intended (e.g., signed in with an organizational account instead of a personal account or vice versa). Check the User account and Identity provider values in the error message. Try signing out and signing in again using a different browser or an incognito/private session.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.