Share via

cannot longer connect my python app to Outlook

ITF 0 Reputation points
2026-03-19T16:56:39.4733333+00:00

Hello Team

I am testing my python script

# EXPLICITLY set the redirect_uri to match your Azure Portal settingtarget_redirect = 'https://login.microsoftonline.com/common/oauth2/nativeclient'if account.authenticate(scopes=['basic', 'mailbox', 'message_all'], redirect_uri=target_redirect):    print('Success! You are logged in.')

leading to >>> Visit the following url to give consent: [Moderator note: personal info removed]

However when clicking on this link to give my consent, this leads to:

This is not the right page

You have reached the wrong page. Please close this app or window and try again.

in addition to a re-direction to [Moderator note: personal info removed]

Could you please assist, as I cannot working on my code (working on an important project)?

It would be ideal to schedule a screen-sharing session to give you all details

Looking forward to hearing from you

Thanks and best regards

[Moderator note: personal info removed]

Outlook | Web | Outlook on the web for business | Security
0 comments No comments

1 answer

Sort by: Most helpful
  1. Chris Duong 8,575 Reputation points Microsoft External Staff Moderator
    2026-03-19T18:30:38.16+00:00

    Hi @ITF

    Thank you very much for reaching out regarding the issue you're facing with your Python script and the consent URL. I truly appreciate your patience and the detailed explanation you provided.

    Based on your description, the behavior you're encountering appears to be directly related to Azure authentication and application registration settings. Since my support category mainly focuses on general Office 365 topics, and your scenario involves Azure / Microsoft Entra ID (authentication, redirect URI, OAuth flow), it falls outside the scope of what I can fully troubleshoot in this area. 

    To ensure you receive the most accurate and dedicated assistance, and to avoid any misunderstandings or delays, I sincerely recommend posting your question in the Azure Community, which is the official channel specializing in Azure identity, authentication flows, and related developer topics 

    User's image The experts and engineers in that community are highly specialized in Azure and will be able to guide you more deeply through your App Registration configuration, redirect URI requirements, and authentication flow. 

    Please accept my apologies for redirecting you to a different community. The members in the category where the question was originally posted primarily focus on Office applications, and may have limited knowledge and resources regarding Azure AD, OAuth, and Graph API authentication. Redirecting you to the correct forum will ensure that you receive faster and more accurate support. 

    I hope this information is helpful. Should you have any further questions or need additional assistance, feel free to reach out.    

    Thank you again for your understanding and cooperation.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any extra questions about this answer, please click "Comment".  

    Note: Follow the steps in our documentation to enable email notifications if you want to receive email notifications related to this topic.  

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.