Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

exchange-autodiscover

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exchange-autodiscover

Access Microsoft's SOAP Autodiscover Service with optional DNS querying

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
decreased by-63.46%
Maintainers
1
Weekly downloads
 
Created
Source

Node Exchange Autodiscover

Retrieve the URL of your EWS by accessing Microsoft's SOAP Autodiscover Service.

Differs from other similar packages in that it queries the DNS. It also tries out all the potential autodiscover urls in parallel, sacrificing a bit more bandwidth for speed.

Usage

const autodiscover = require('exchange-autodiscover');

// Promise
autodiscover({ emailAddress: "foo@bar.onmicrosoft.com", password: "pass" })
  .then(console.log.bind(console))  // 'https://outlook.microsoft.com/ews/exchange.asmx'
  .catch(console.error.bind(console));

// Callback
autodiscover({
  emailAddress: "foobar@yourdomain.com",
  password: "pass",
  username: "ad\\foobar77"
}, function(err, ewsUrl) {
  if (err) {
    console.error(err);
  } else {
    console.log(ewsUrl); // 'https://mail.yourdomain.com/ews/exchange.asmx'
  }
});

You can optionally request any of the extra settings found here. This will return an object with matched settings (EWS address will always be included by default).

// With extra settings
autodiscover({
  emailAddress: "foo@bar.onmicrosoft.com",
  password: "pass",
  settings: [
    'EwsSupportedSchemas',
    'ExternalEwsVersion'
  ]
}).then(function (settings) {
  console.log(settings);
  // {
  //   EwsSupportedSchemas: 'Exchange2007, Exchange2007_SP1, Exchange2010, Exchange2010_SP1, Exchange2010_SP2, Exchange2013, Exchange2013_SP1, Exchange2015',
  //   ExternalEwsUrl: 'https://outlook.office365.com/EWS/Exchange.asmx',
  //   ExternalEwsVersion: '15.00.0000.000'
  // }
});

API

/**
 * Tries to find the url of the EWS.
 * @param   {Object}   params
 * @param   {string}   params.emailAddress
 * @param   {string}   params.password
 * @param   {string}   [params.username] - Defaults to emailAddress
 * @param   {boolean}  [params.queryDns] - Defaults to true
 * @param   {string[]} [params.settings]
 * @param   {Function} [cb]
 * @returns {Promise}  Resolves with the EWS url
 */
autodiscover(params, callback);

FAQs

Package last updated on 28 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc