Getting Error: "error": "access_denied", "Cannot read properties of undefined (reading 'id')" when using grant_type "password" in /oauth/token API

I received
{
“error”: “access_denied”,
“error_description”: “Cannot read properties of undefined (reading ‘id’)”
}
error using grant_type “password” in /oauth/token API.
My Auth0 application is configured to allow the Password Grant Type. Any one has any thoughts on how to debug this issue?

Hi @harshil.jariwala

Thank you for reaching out to us!

It is possible that the error occurs when the grant type is not properly enabled for your application. If this is the case, you can correct it the following way:

  • In the Auth0 Dashboard, navigate to your application’s Advanced Settings,
  • Turn off the ‘Password’ grant type,
  • Save the changes,
  • After this, turn the ‘Password’ grant type back on,
  • Save the changes again.

This might seem counterintuitive, bought it was also brought up in a previous Community post where this has solved an issue, but on the Management API-side.

You can find more information regarding the password grant type, in case it might prove useful, on our doc : Resource Owner Password Flow

Let me know if this helped with the issue!
Gerald

Thanks for taking your time to provide solution, but unfortunately, it didn’t resolve the issue. Do you have any additional suggestions or thoughts on what might be causing the problem?