How to make a username password request with auth0 custom api, getting error "unsupported grant type: password" error

MonkeyBonkey

I tried using the auth0 postman template to make an authentication request using username and password and I'm getting an unsupported grant type: password error. What am I doing wrong?

var client = new RestClient("https://test.auth0.com/oauth/token");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "abc");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "grant_type=password&client_id=foo&audience=&username=test&password=test&scope=openid%20email%20picture%20nickname", ParameterType.RequestBody);
The Muffin Man
  1. Log into the Auth0 dashboard
  2. Go to account settings (top right under your username)
  3. On the general tab scroll down to the API Authorization Settings section
  4. Default Audience would be your API identifier (if you have an API)
  5. Default Directory would be your connection such as database connection name

In your POST to oauth/token do not include audience (if you specified the default above).

Gotta love how Auth0 makes authentication easy and painfully hard at the same time.

Refer below screenshot as a reference. enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Sendgrid API - Bad username / password error

API 400 error Username required Password required

Unable to make api request to backend getting Axios network error

Getting a CORS error when trying to authenticate user with Auth0

I am getting an error on login with Auth0 and NextJs

How can I avoid getting error code 0 on Google Custom Template request?

JWT: How do I implement my custom error message on password or username is wrong Django REST

How to make the login error("Wrong username/password") be more specific in a Login Page

How to create a direct link to an account to log in directly without username and password using auth0

Auth0 LoginAsync error

VSTS REST API Error when using Basic Authorization (username & password)

PrincipalSearcher Wrong Username Or Password error

How to return HttpResponseException with error specificaton (invalid username or invalid password) to the frontend?

How to throw an error for Invalid username or password if the data is not matched with the DB?

Access token vs username/password for api request

Need to make a login window with username and password in C# but when i introduce an incorrect username or password i get an error

LockModule.init undefined error in auth0 react-android getting started

Django custom auth model registration form returns unique username error

getting error in a simple api request using node JS request lib

How to fix 502 error getting on post request?

ROPC - Getting "invalid_grant" error with description as "AADSTS50126: Invalid username or password"

Only getting the validation error for Password field and not for username field with HTML.ValidateMessageFor

Auth0 gradle dependency error

The connection is not found error in auth0

Auth0 seed project error

Auth0 "service not found" error

Auth0 with Angular 4 login error

Getting an error on request

How do I make a requesocks request with socks5 username and password?