2

I am using request npm package to call api that uses windows authentication. I make call to GET method as below. But I get 401 UNAUTHORIZED as response code.

var request = require('request');
 
var options = {
  url: 'http://url',
  method : 'GET',
  json : true,
  headers: {        
        'Authorization': 'NTLM MpJfHMQjKT4V8txCgAQAAAAAAAAAAAAAAAAAAAAAAAJAFIASABUAFQAUAAvAGgAcQBtAGUAcgBjAGgAcwB2AGMAMAAxAHQAMQBiAC4AZABzAHQAZQBzAHQALgBkAHIAdQBnAHMAdABvAHIAZQAuAGMAbwBtAAAAAAAAAAAAAAAAAEZDtgUbISIZWdfhvrcI7aujEgQQAQAAAJTRhB/tA+DyAAAAAA=='
    }
};
 
function callback(error, response, body) {
    console.log(response.statusCode);
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
  }
}
 
request(options, callback);

Please help me, how to call API that uses ASP.NET web API windows authentication using node.js ?

Thanks in advance!

Community
  • 1
  • 1
Thangakumar D
  • 714
  • 5
  • 12
  • 27

0 Answers0