Skip to content

Instantly share code, notes, and snippets.

@cianclarke
Created July 27, 2015 16:38
Show Gist options
  • Save cianclarke/617e2fe7c98ee1842d89 to your computer and use it in GitHub Desktop.
Save cianclarke/617e2fe7c98ee1842d89 to your computer and use it in GitHub Desktop.
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var request = require('request');
request.post({
url : 'https://master00-bf85.oslab.opentlc.com:8443/oauth/authorize',
json : true,
auth : {
user : 'andrew',
pass : 'pass',
sendImmediately : true
},
headers : {
"X-CSRF-Token" : "1"
},
followAllRedirects : true,
qs : {
response_type: "token",
client_id: "openshift-challenging-client"
},
/*formData : {
username : 'andrew',
password : 'pass',
//csrf: 'foo'
}*/
}, function(err, response, body){
console.log(err);
console.log(response.statusCode);
console.log(response.headers);
console.log(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment