# Incorrect Python sample code on Client Credentials Flow page

**URL:** <https://community.auth0.com/t/incorrect-python-sample-code-on-client-credentials-flow-page/72215>\
**Category:** Get Help\
**Tags:** documentation\
**Created:** [October 27, 2021, 11:57pm UTC](https://community.auth0.com/t/incorrect-python-sample-code-on-client-credentials-flow-page/72215 "2021-10-27T23:57:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nk9](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nk9/32/29292_2.png) [@nk9](https://community.auth0.com/u/nk9)\
**Post date:** [October 27, 2021, 11:57pm UTC](https://community.auth0.com/t/incorrect-python-sample-code-on-client-credentials-flow-page/72215/1 "2021-10-27T23:57:27Z")

</div>

The Python sample code on the [Client Credentials Flow page](https://auth0.com/docs/authorization/flows/call-your-api-using-the-client-credentials-flow) 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:

```auto
conn = http.client.HTTPSConnection(YOUR_DOMAIN)
# [...]
conn.request("POST", "/oauth/token", payload, headers)

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 28, 2021, 3:49am UTC](https://community.auth0.com/t/incorrect-python-sample-code-on-client-credentials-flow-page/72215/2 "2021-10-28T03:49:41Z")

</div>

Hi @nk9,

Welcome to the Auth0 Community!

I understand that you have found a scenario where our sample code for the Python example in the [https://auth0.com/docs/authorization/flows/call-your-api-using-the-client-credentials-flow](https://auth0.com/docs/authorization/flows/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`](https://www.rose-hulman.edu/class/cs/archive/csse120-old/csse120-old-terms/201110/Resources/python-3.1.2-docs-html/library/http.client.html) 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.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 12, 2021, 3:54am UTC](https://community.auth0.com/t/incorrect-python-sample-code-on-client-credentials-flow-page/72215/4 "2021-11-12T03:54:20Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
