Start a new topic

Basic Authentication in Business Logic

Is there support for using basic authentication with a 3rd-party API in business logic?
1 Comment

Yes, basic auth is supported as per the sample below:



request.get({'uri': 'http://someurl.com/api/record/1'

'auth': {

'username':'your_username',

'password':'your_password'

}

}

,function(error, res, body){

if (error){

logger("error");

response.error = (error);

} else {

logger("success");

response.body = JSON.parse(body);

response.complete(res.status);

}

});



The username and password values will be automatically base64-encoded.
Login or Signup to post a comment