Friday, 14 April 2017

How to authenticate using appid and appsecret in nodejs using https request

Here is the sample code for my application. Why It's not working

var post_data = JSON.stringify({
'appid' : results.appid,
'appsecret': results.appsecret,
});

var url = serviceUrl+"/oauth-service/oauth/token?grant_type=client_credentials";
const req = https.request(url + post_data, function(res) {
res.setEncoding('utf8');
res.on('data',function(chunk){
console.log(chunk);
});
});
req.write(post_data);
req.end();



via Lakshman

No comments:

Post a Comment