Authorization extension - Unauthorized

Hello. I’ve been trying some functionalities of Auth0 and I’m having some problems with Authorization Extension. I want to use the Authorization Extension to manage groups, roles and permissions. But no matter what I do, I always receive “Unauthorized” as answer. You can see my code in Python below:

import http.client

conn = http.client.HTTPSConnection("<name>.auth0.com")

payload = "{\"client_id\":\"<client_id>\",\"client_secret\":\"<client_secret>\",\"audience\":\"urn:auth0-authz-api\",\"grant_type\":\"client_credentials\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/oauth/token", payload, headers)

res = conn.getresponse()
data = res.read()
data_dict = eval(data.decode("utf-8"))


headers = { 'authorization': "Bearer "+ data_dict['access_token']}

conn.request("GET", "/api/groups", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Could someone help me? Thanks in advance

Hey there!

Sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes the number of incoming questions is just too big for our bandwidth. Sorry for such inconvenience!

Do you still require further assistance from us?