7

I am attempting to use Node.js to call the SOAP Exchange EWS services. I have created a simple http client like so:

var https = require('https');

var username = 'user';
var password = 'password';
var auth = 'NTLM ' + new Buffer(username + ":" + password).toString('base64');

var options = {
    host : 'exchangehost',
    port : 443,
    method : 'post',
    path : '/Exchange.asmx',
    headers : { Authorization : auth }
};

var request = https.request(options, function(response) {
    console.log('Status: ' + response.statusCode);
};

request.write('<soapenv:Envelope  ...></soapenv:Envelope>');
request.end();

I receive a status code 401, I suspect because I am not doing the three steps involved for NTLM authentication (http://www.innovation.ch/personal/ronald/ntlm.html). Does anyone know of a Node.js module for communicating with Exchange EWS directly or for authenticating using NTLM, or am I going to need to implement that protocol for Node.js myself? Any assistance is greatly appreciated.

maerics
  • 151,642
  • 46
  • 269
  • 291
AngryMonkey
  • 144
  • 1
  • 1
  • 7

4 Answers4

1

I have used node-ews successfully to communicate with EWS.

node-ews uses httpntlm internally for NTLM authentication.

Personally, I think node-ews is your best bet, since its pretty much already implemented everything you need to interact with EWS.

Aaron C
  • 884
  • 10
  • 25
  • Hi Aaron, have you by any chance managed to use the GetRoom function? I'm trying to get the calendars for my works room to see which are available – Bidstrup Nov 25 '16 at 16:26
  • @RasmusBidstrup I have not, however, there are a few steps you must get right. 1) have a well formated JSON object for the request see [issue#27](https://github.com/nmarus/node-ews/issues/27) at `node-ews` project page. 2) make sure the parameters you are using are valid (like correct email address). Feel free to [create an issue](https://github.com/nmarus/node-ews/issues/new) and I will try to help as much as I can. – Aaron C Nov 25 '16 at 18:57
  • Thank you :-) Im a bit confused about the name EWS are using, Is it correct that its Appointments/meeting for a Room(by email or name) i need to find, and not a Calender? I will make a case trying to explain what I have done and where I'm stuck. – Bidstrup Nov 25 '16 at 19:58
0

Have you tried the httpntlm module? https://github.com/SamDecrock/node-http-ntlm

Jason
  • 311
  • 4
  • 16
  • This looks promising and simple. I'm not trying to do this anymore but if someone can verify that it works I'll mark it as accepted since this appears to be a more general purpose NTLM connector. – AngryMonkey Sep 30 '15 at 15:48
0

Have you tried ews-javascript-api npm module, it has all the features you are looking at + very simple ntlm authentication using ews-javascript-api-auth module. NTLMv2 is also supported.

I added this as answer as it would provide complete answer to question title (integration). These are github links, question is little generic so samples provided at github readme should work.

[disclaimer - I am the author]

Gautam Singh
  • 1,028
  • 1
  • 9
  • 13
-1

I've found this one Node.js module that supports communicating with Exchange 2010, however I'm still trying to figure out how to use it personally, the documentation is light. https://npmjs.org/package/exchanger

tdm00
  • 89
  • 5
  • Thanks, looking for more of a direct approach without the module. I'll check that out though and see if the module works as well. – AngryMonkey Jul 01 '13 at 21:49
  • I tryed to use `exchanger` but at the moment there is an error with `node-expat` that prevented me from further testing. `Error: Cannot find module '../build/Release/node_expat.node'` – Aaron C Oct 19 '16 at 13:40