skip to Main Content

I want to access the outlook API with a Python application. I followed this guide but quickly ran into authentication issues. Tried it with my existing private Microsoft account and with a new created account, but ran into authentication issues quickly. Whenever I try to do anything in the portal, I get this message:
enter image description here

Already checked in with the general Microsoft support. They directed me towards Azure support, but I can’t reach anybody there.

2

Answers


  1. I tried to reproduce the same in my environment and got the same error as below:

    enter image description here

    The error usually occurs if the Microsoft personal account is not added as an external/guest user to an Azure AD tenant.

    To resolve the error, contact the Global admin to invite the account as a guest user like below:

    enter image description here

    Once the admin invites, you will get an email notification to accept the invitation like below:

    enter image description here

    After accepting the invite, the Personal Microsoft account will be added to the tenant successfully like below:

    enter image description here

    And now you will be able to access the Azure Portal without any issue and you can also create your own tenant to have admin access.

    If still the issue persists, try the below:

    • Sign out from the active session and sign in incognito window or any different browser.
    • Clear browser cache and cookies and try.
    • Confirm whether the admin has set any External user settings that is restricting the access:

    enter image description here

    Reference:

    Error AADSTS50020 – User account from identity provider does not exist in tenant – Active Directory

    Login or Signup to reply.
  2. When looking into the Build Python apps with Microsoft Graph tutorial that you followed, one of the pre-requisites mentioned signing up for the Microsoft 365 Developer Program to get a free Microsoft 365 subscription. After you sign-up, you’ll need to use the Microsoft 365 developer sandbox credentials in order to continue following the tutorial without having to leverage your own Azure AD tenant or subscription (pay-as-you-go).

    Build Python apps with Microsoft Graph:

    1. Join the Microsoft 365 Developer Program
    2. Deploy the Developer Sandbox
    3. Using the Microsoft 365 Developer subscription(s) info you’ll be able to login to the Azure Portal or Azure Active Directory admin center.

    Note: You can navigate to your developer tenant using - https://aad.portal.azure.com/<<SandboxTenantName>>.onmicrosoft.com, or when prompted to sign in use your sandboxes’ admin account.

    Microsoft 365 Developer Sandbox login

    If you only signed up for a new personal Microsoft account (Outlook), you’ll notice that once you sign into the Azure AD Admin Center, your Outlook.com user isn’t associated with any Azure tenants, and you’ll run into the authentication issue error message that you referenced, so you’ll have to create your own Azure AD tenant by signing up for an Azure Free Trial or Pay-as-you-go.

    Outlook Login

    I hope this helps!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search