Auth0 Home Blog Docs

Invalid_grant error code received instead of documented error codes

custom-database

#1

I followed the following guides to integrate our existing api with Auth

In the example, I followed using WrongUsernameOrPasswordError(email) for error handling wrong passwords and was expecting invalid_user_password as the error but all we keep getting in invalid_grant. Where is invalid_grant documented as I can’t seem to find it?

We are getting this when requesting for resource owner access token but the same also happens even without a custom audience.

Here is an example request.

POST https://{instance}.auth0.com/oauth/token
{
“grant_type”: “http://auth0.com/oauth/grant-type/password-realm”,
“client_id”: “{clientid}”,
“username”: “{username}”,
“password”: “{password}”,
“realm”: “Username-Password-Authentication”,
“audience”: “https://{resourceowner}/api”,
“scope”: “openid email”
}