Title: Azure error AADSTS50020 while loggin in from VS2022
Tags: azure;azure-active-directory;azureportal
Question: AADSTS50020: User account 'my@email' from identity provider 'https://sts.windows.net/783c0fcf-4d70-4426-9bbc-1e83f8b865b2/' does not exist in tenant 'Default Directory' and cannot access the application '872cd9fa-d31f-45e0-9eab-6e460a02d1f1'(Visual Studio).
I am logging in with an account (mine) that is a Global Administrator and owner of that Azure organization. How can I be not authorized? This makes zero sense -__- As a test I invited my other email (on a different domain) as an external guest and the login worked for that account. So I can login as a guest but not as an owner.



Here is another answer: There maybe relatably few possible causes for this error.
```Possible cause 1
```

Please check if you might have  already have an active session that
uses a different account  (personal) than the one that's intended to
be used where you are admin. Or  it maybe meant for guest user
account.

To see if above is the reason, look for the User account and Identity
provider values in the error message. Check if those values match the
expected combination .

See if sign in is done by using organization account to your tenant
instead of  home tenant Or is the login is by using a different
personal account than the one that needed to be.
Resolution


To resolve this issue please sign out from active session, then sign in again from a different browser or a private browser session.
```Cause 2
```

Also if you have set Supported account types to Multiple
organizations. But if your authentication call is for specific tenant
i.e., https://login.microsoftonline.com/tenant name or id. In that
case users from other organizations cannot  be able to access the
application and those users are required to be added as guests in the
tenant specified in the request.Maybe this seems to be the reason for
as guest account is signed in.
Resolution

So for multiple organizations, authentication request should either
be common or organizations ex:
https://login.microsoftonline.com/`organizations` or
https://login.microsoftonline.com/`common`


Also check Error AADSTS50020 - User account from identity provider does not exist in tenant - Active Directory | Microsoft Docs to troubleshoot in other cases.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:05/03/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<azure><azure-active-directory><azureportal>', 'Title': 'Azure error AADSTS50020 while loggin in from VS2022', 'ViewCount': 389, 'id': 72094164, 'user_AboutMe': '<p>Addicted to learning and electronic music. <br>\nInterested in the stock market, cryptocurrencies, space exploration. Tinker with raspberry pi which led me to add <a href="https://www.hackster.io/ihorbond/control-your-car-with-alexa-5e1a29" rel="nofollow noreferrer">Alexa voice control to my car</a> <br> </p>\n<p>Fav books: Permanent Record, Millionaire Fastlane, The Phoenix Project.</p>\n<p><a href="https://www.eff.org/" rel="nofollow noreferrer">EFF</a> Member |  &gt; G <br><br>\n<strong>Open to job offers and freelance work</strong>. <br>\nLikes: SQL | C# | .NET Core | Angular | Vue | Ionic | Firebase | Solidity <br></p>\n', 'user_AccountId': 12081838.0, 'user_DisplayName': 'ihor.eth', 'user_Reputation': 1961.0, 'user_Views': 244.0, 'user_id': 8833279.0}}