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:
Hey there everyone, I wanted to follow up and let you know that the Authorization Extension: Blocked Event Loop Github issue has been updated and closed.
As stated in the Github issue comment, the following solution for the issue is as follows:
To fix this issue perform the two following actions:
Migrate your Auth0 tenant from Node 4 to Node 8 and then republish the Auth0 rule that is created by the Authorization Extension. Here is the documentation page that explains how to migrate your te…
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.
Hello,
We are facing an issue with the authorization extension in our production tenant, although everything is working fine in our QA tenant.
When invoking the GET /users endpoint , I get 500 Internal Server Error.
In the realtime webtask logs I see the output below. It seems to me that the Authorization Extension is trying to invoke the Auth0 Management API but with incorrect credentials. I don’t know where it is getting the client ID “F4T52F8R1g2JoSDgy7xLK91nJHunGv6u” from. There is no appl…
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
dan.woda
Closed
September 12, 2019, 1:10pm
14
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.