Getting "Unauthorized" error response when using "Resource Owner Password" API

Hi,

I’m new to Auth0 and I’m trying to see if I can use it to create a custom login form on my website and authenticate a user using the authentication API. I found this page - https://auth0.com/docs/api/authentication#resource-owner-password - and thought it’s the best option for what I’m trying to do. I downloaded the postman collection and followed the instructions on this page - https://auth0.com/docs/flows/call-your-api-using-resource-owner-password-flow. However, when I started testing it, it always gives me a 401 error:

{
    "error": "access_denied",
    "error_description": "Unauthorized"
}

I googled a bit more and found that I can enable the Password grant type, but even after doing this, I still get a 401 error. Am I missing something?

Some details:

Regards,
Marlon

Hey @ponki.d.monkey, Welcome to the Auth0 Community!

From the looks of it you request seems correct, I checked your tenant as well and it looks ok, only
thing i suspect is your client_id , I think there is a trailing space in there, can you check it?

Regards,
Sidharth Chaudhary

Hi,

Thanks for your reply.

I checked the client_id on my request and it doesn’t have a trailing space. And just to be sure, I copied it again using the Copy to clipboard button from my application details page. I also double checked all other request parameters if they have a trailing space and they have none. Not sure if it’s worth trying to post from a sample custom login page. What do you think?

Regards,
Marlon

Hey Marlon, Can you DM me a Curl version of your token request(removing the secret)? I will replace with my params and try on my side as well

Ok sure. Give me a sec. I’ll just compose the curl request and DM it to you.