Broken authorization extension API /users and /users/{user_id}

Hi all,

I am using an authorization extension to manage my users’ groups and roles but I found that I could not call Authorization Extension API /users and /users/{user_id} but /groups, /roles, /permissions and /users/{user_id}/roles work fine.

I have Internal Server Error when calling /users and /users/{user_id}.

Would someone in auth0 have a look?

Thanks a lot!

Hey @quincy.milliman,

I’m going to take a look into this and report back.

Thanks,
Dan

1 Like

Hi Dan,

Thank you very much! Now I had some other issue regards to the authorization extension API /groups – it gave me the following message:

{
“code”: 500,
“error”: “Script generated an unhandled asynchronous exception.”,
“details”: “Error: Blocked event loop”,
“name”: “Error”,
“message”: “Blocked event loop”,
“stack”: “Error: Blocked event loop\n at :1:38\n at _combinedTickCallback (internal/process/next_tick.js:131:7)\n at process._tickDomainCallback (internal/process/next_tick.js:218:9)”
}

How could I solve this “Blocked event loop” error?

@quincy.milliman,

Could you post the code you use to make the call to the api?

Thanks,
Dan

Also, I was able to get the ‘get all users’ and ‘get user’ endpoints working correctly. Can you post error code and the request you are making so I can take a look?

Thanks,
Dan

Hi Dan,

Thanks for your reply. Here is my sample code in python to generate the error:

headers = {‘content-type’: ‘application/json’, ‘authorization’: ‘Bearer eyJ0eXAiOi…zip…TJg’}
conn = http.client.HTTPSConnection(“milliman-chess.eu8.webtask.io”)
path = “/adf6e2f2b84784b57522e3b19dfc9201/api/users”
conn.request(“GET”, path, “”, headers)
resp = conn.getresponse()
data = resp.read().decode(“utf-8”)

Where eyJ0eXAiOi…zip…TJg is my access key gotten by the following code:

conn = http.client.HTTPSConnection(AUTH0_DOMAIN)
payload = “grant_type=client_credentials&client_id={}&client_secret={}&audience={}”.format(AUTH0_M2M_CLIENT_ID, AUTH0_M2M_CLIENT_SECRET, “urn:auth0-authz-api”)
headers = { ‘content-type’: “application/x-www-form-urlencoded” }
conn.request(“POST”, “/oauth/token”, payload, headers)
res = conn.getresponse()
data = res.read().decode(“utf-8”)
conn.close()
return json.loads(data)

Thanks alot!

I found this while I was digging:

Let me know if this solves it.

Warm Regards,
Dan

2 Likes

Hi Dan,

Thanks for the reference. I checked my account. It is using Node 8. The issue of “Blocked Event Loop” did not appear always and it seems working now. (no such error for the APIs /groups, /roles, /permissions and /users/{user_id}/roles )

However, when I call Authorization Extension API /users and /users/{user_id} they are still bugged with error :

{“statusCode”:500,“error”:“Internal Server Error”,“message”:“An internal server error occurred”}

Can you take a look at this topic and see if it guides you to a solution?

It sounds like a similar issue.

Hi Dan,

I checked the article and I could not find where the “network tab” mentioned in your article is and I have one Auth0 Authorization extension API with identifier name “urn:auth0-authz-api”.

Hi @quincy.milliman,

I sincerely apologize for the delay in response on this, it seemed to have slipped through the cracks.

Are you still running into this issue? In regards to the network tab; it is a tool available in chrome’s inspector.

Thanks,
Dan

Hi Dan,

I got the error message directly from Auth0 server though… I have some workaround to get all users via roles.

1 Like

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