Hello @Gabriel Pillay
Thanks for reaching out!
Based on my research on this issue, there could be multiple reasons you are facing this error.
- Generally, error AADSTS50020 comes when a user is not authorized to call an endpoint. Make sure to use right auth token with right permissions (Please note that Calendars.ReadWrite.Shared is a Delegated permission). Refer this Permissions document to know more about it.
- You're trying to login to an application in your tenant with a user account which is not a part of your tenant. In this case, user account needs to be added as an external user in the tenant first. Refer this documentation to know more on this.
To add guest users to an application, follow this document.
References:
https://learn.microsoft.com/en-us/answers/questions/790333/error-code-aadsts50020-while-access-to-the-aad-con.html
https://learn.microsoft.com/en-us/azure/active-directory/external-identities/add-users-administrator
https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/error-code-aadsts50020-user-account-identity-provider-does-not-exist
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.