Wednesday 24 May 2017

OAuth2 using Curl/Node.js is not giving any response

I'm able to sucessfully create the Access token using postman with following parameters, Callback URL: https://www.getpostman.com/oauth2/callback Token Name: Auth URL: Access Token URL: Client ID: Client Secret: Grant Type:Client Credentials.

But I could not able to get the access token via Curl or node.js as below,

var request = require("request");
var options = { method: 'POST',
  url: '',
  headers: { 'content-type': 'application/json' },
  body: '{"client_id":"","client_secret":"","audience":","grant_type":"client_credentials"}' };
request(options, function (error, response, body) {
  if (error) console.log(error);
  //console.log(response);
  console.log(body);
});

where I mapped my postman details to node.js script as,

Auth URL: url
Access Token URL: audience
Client Id: client_id
Client Secret: client_secret
Grant Type: grant_type

But I didn't any response. May I Know where i went wrong? or do we have any other mechanism to get the OAuth2 access token?

I'm just followed the script from https://manage.auth0.com/#/apis/590983763e3ae44a0dd1a219/test



via irs102info

No comments:

Post a Comment