Ruby client for Microsoft's Autodiscover Service.
The Autodiscover Service is a component of the Microsoft Exchange architecture. Autoservice clients can access the URLs and settings needed to communicate with Exchange servers, such as the URL of the endpoint to use with the Exchange Web Services (EWS) API.
This library implements Microsoft's "Autodiscover HTTP Service Protocol Specification" to discover the endpoint for an Autodiscover server that supports a specified e-mail address and Microsoft's "Autodiscover Publishing and Lookup Protocol Specification" to get URLs and settings that are required to access Web services available from Exchange servers.
This library requires the following Gems:
- HTTPClient
- Nokogiri
- Nori
The HTTPClient Gem in turn requires the rubyntlm Gem for Negotiate/NTLM authentication.
require 'autodiscover'
client = Autodiscover::Client.new(email: "[email protected]", password: "tps_eq_awesome")
data = client.autodiscover
# Get the EWS endpoint
data.ews_url
# Get an Exchange Version ingestible by EWS
data.exchange_version
# Access the raw Autodiscover data in its entirety
data.response
Besides :email
and :password
, Autodiscover::Client
can take a few other options as can the #autodiscover method.
Examples:
# Use a different username than your e-mail.
client = Autodiscover::Client.new(email: "[email protected]", password: "tps_eq_awesome", username: 'INITECH\blumbergh')
# Override the domain
client = Autodiscover::Client.new(email: "[email protected]", password: "tps_eq_awesome", domain: "tpsreports.local")
# Set a custom connection timeout
client = Autodiscover::Client.new(email: "[email protected]", password: "tps_eq_awesome", connect_timeout: 5)
# Ignore SSL Errors
client.autodiscover(ignore_ssl_errors: true)
gem 'autodiscover', :git => 'git://github.com/WinRb/autodiscover.git'
git clone http://github.com/WinRb/autodiscover.git
cd autodiscover
gem build autodiscover.gemspec
sudo gem install autodiscover-<version>.gem
Limitations:
- Doesn't support querying the DNS for SRV Records
Please submit additional bugs and issues here http://github.com/WinRb/autodiscover/issues