Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js integration with MS Exchange EWS [closed]

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.

like image 644
AngryMonkey Avatar asked Feb 08 '12 21:02

AngryMonkey


People also ask

How do I know if exchange EWS is enabled?

You can verify independently if a mailbox is accessible using EWS with the following steps: Go to https://testconnectivity.microsoft.com. If using Microsoft 365, click the Microsoft 365 tab. Select Service Account Access (Developers) then click Next.

How do I enable EWS on exchange?

On the Exchange Server hosting the Exchange Web Services open the Internet Information Services (IIS) Manager administrative tool. Navigate through to Server | Sites | Default Web Site | EWS. Select the Authentication icon from the feature view. Ensure that Basic Authentication is enabled.

Does OWA use EWS?

This option can be useful when you don't have your Outlook app at hand. Still, in companies using Exchange Online, OWA and EWS can go hand-in-hand. For example, your employees can use OWA to check their emails, access their calendars, revise their To-Do lists, all without being on their device.

What is Exchange EWS used for?

Exchange Web Services (EWS) is a cross-platform API that enables applications to access mailbox items such as email messages, meetings, and contacts from Exchange Online, Exchange Online as part of Office 365, or on-premises versions of Exchange starting with Exchange Server 2007.


1 Answers

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.

like image 166
Aaron C Avatar answered Oct 02 '22 07:10

Aaron C