title: NTLM Api access with Node.js
body: <p>Full disclaimer: I have never worked with Microsofts NTLM before.</p>
  
  <p>I've tried around 30 different ways to access the 7Pace timetracker API on our local TFS instance. I know it works if i access the URI directly in Chrome, it prompts me for my AD login, and swiftly serves me all the data requested. Same for Postman, except there is an authentication tab for NTLM ahead of time.</p>
  
  <p>Postman suggests this for Node.js using request:</p>
  
  <pre><code>var request = require("request");
  
  var options = {
   method: 'GET',
   url: 'http://TFSURL/odata/TimeExport%28StartDate=%272018-11-14%27,EndDate=%272018-11-14%27%20,PopulateTopParentColumns=null,GroupTimeByDateByUser=null,IncludeBillable=null%29',
  headers: {
   'cache-control': 'no-cache',
    Authorization: 'NTLM NOTTHEREALTOKENKJASDKLHWKLLASBEDBSDAOBAW' 
   }
  };
  
  request(options, function (error, response, body) {
    if (error) throw new Error(error);
    console.log(body);
  });
  </code></pre>
  
  <p>This returns nothing. Notice the Authorization header. I've tested multiple different variants of similar. My next guess was to request through Chrome, then sniff it with Tellerik Fiddler and try to replicate the headers. I've done this as well, but to no avail. I end up with a very similar result to that above, except chrome uses negotiate:
  <a href="https://i.stack.imgur.com/mf6tF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mf6tF.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/XqxsT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XqxsT.png" alt="enter image description here"></a></p>
  
  <p>Any ideas on how to go about this ? Maybe other debugging options?</p>