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);
API Authorization Settings
sectionDefault Audience
would be your API identifier (if you have an API)Default Directory
would be your connection such as database connection nameIn 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.