Hi @vegeta psych ,
Thank you for posting this in Microsoft Q&A.
I understand you want to perform an outlook login, so that you can get calendar events.
This Eror AADSTS50020 occurs in various scenarios. To resolve this issue, Follow the below steps:
1.Register your application as Enterprise application
Sign into the Microsoft Entra admin center -> Browse to Identity > Applications > App registrations and select new registration.
Enter name of the application and make sure to select supported account type as Accounts in any organizational directory and personal Microsoft accounts
**(**supports both Microsoft and personal accounts)
2.API Permissions: Add permissions for Microsoft Graph API and grant admin consent for the application.
Calendars.ReadBasic, Calendars.Read, Calendars.ReadWrite
3.When you get an access token, make sure to set URL as https://login.microsoftonline.com/common
and call the Event API endpoint.
For your reference: https://learn.microsoft.com/en-us/graph/api/calendar-list-events?view=graph-rest-1.0&tabs=http
To get refresh tokens please refer this document
Hopes this helps. Do let us know if you any further queries.
Thanks,
Navya.