The Python sample code on the Client Credentials Flow page does not work in Python 3.9. The problem is in the first section, on Request Tokens. You have to place the domain in the call to create the connection, like this:
conn = http.client.HTTPSConnection(YOUR_DOMAIN)
conn.request("POST", "/oauth/token", payload, headers)
Welcome to the Auth0 Community!
I understand that you have found a scenario where our sample code for the Python example in the Call Your API Using the Client Credentials Flow docs does not work in Python.
I have just tested this myself and can confirm your same observations. Great call out on this!
I have also checked the documentation for the
http.client.HTTPSConnection module, which defines that it should not be empty.
I will inform our Docs Team about getting the sample code corrected.
Please let me know if there’s anything else I can do to help.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.