Error: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url:Max retries exceeded with url: /b458eb0a-178f-4197-8da4-514c0fe6f17b/v2.0/.well-known/openid-configuration

Dhage, Endraja (CIB Tech, IND) 0 Reputation points
2023-04-24T08:50:40.7+00:00

I am trying to connect Microsoft graph api in python using msal library see the below link https://blog.darrenjrobinson.com/microsoft-graph-using-msal-with-python-and-certificate-authentication/ where I am passing client id, tenant id and certificate. I have tried to manually connect to https://login.microsoftonline.com from browser and it is working but not connecting with python. I am getting below error requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /b458eb0a-178f-4197-8da4-514c0fe6f17b/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000019C13E0F3D0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond')) Can any one help on this please .. Thanks, Endraja

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Security | Microsoft Authenticator
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,881 Reputation points
    2023-04-25T06:53:37.4566667+00:00

    Hi Dhage, Endraja (CIB Tech, IND) , you can refer to this tutorial on Build Python apps with Microsoft Graph and app-only authentication in the documentation, and the documentation about Client credentials provider for python. Hope this helps. Best Wishes. User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    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.