Professional Documents
Culture Documents
Page 2 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
The first article is dedicated to presenting the logic and the involved components in
the Autodiscover flow that is implemented in an Office 365 based environment.
In the next two articles, we will review the Autodiscover flow that is implemented in
an Office 365 based environment by using the Microsoft web based tool, the
Microsoft Remote Connectivity Analyzer (ExRCA).
Note you can read more information about how to use the Microsoft Remote
Connectivity Analyzer (ExRCA) tool in the article Microsoft Remote Connectivity
Analyzer (ExRCA) | Autodiscover troubleshooting tools | Part 2#4 | Part 22#36
Page 3 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Page 4 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Autodiscover Endpoint will query DNS looking for a host named o365info.com. In
case the Autodiscover client didnt manage to connect the specified host name, the
Autodiscover Endpoint will move on to step 2, in which the Autodiscover client tries
to locate a potential Autodiscover Endpoint using the host name
autodiscover.o365info.com
The basic assumption is that in an Exchange on-Premises based environment, the
organization allocates a Public facing Exchange CAS server who will serve as a
representative for the domain name o365info.com and, the FQDN
autodiscover.o365info.com is mapped to this Public facing Exchange server.
When the Autodiscover client manage to locate the Autodiscover Endpoint, the
Autodiscover client will request from the Autodiscover Endpoint to proof his
identity by providing a Public server certificate.
The Autodiscover Endpoint will provide the required certificate, and the
Autodiscover client will verify that the server certificate includes the domain name
o365info.com (in a scenario of a wildcard certificate) or the host name
autodiscover.o365info.com.
In the Exchange Online environment, the described scenario cannot be
implemented because a very simple reason:
In reality, the cloud infrastructure (Office 365 and Exchange Online) is not able to
allocate a dedicated public certificate for each of the Office 365 tenants and, for
each of the public domain that the registered at Office 365.
In Exchange Online, a specific Exchange server (or array of Exchange Online server)
can represent a hundred or a thousand different domain at the same time.
The concept in which the Autodiscover Endpoint (the Exchange server) provides a
public certificate that includes a reference to the specific client domain cannot be
implemented!
So, the big question is how do we solve the problem that will enable Autodiscover
clients to access their Exchange Online mailbox?
And the answer is redirection.
Page 5 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Page 6 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Page 7 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
The solution is to let the Autodiscover client think that he is communicating with
a specific host while in practice, he communicates with another element that
present himself as the element that the Autodiscover client think he is.
Sound like a conspiracy?
Yes, a little
In a cloud only environment (mail infrastructure that is fully hosted on the cloud)
Office 365 subscriber need to update their public DNS by adding a new CNAME
record.
Note there are a couple if DNS records that Office 365 subscribers need to add
and update in their public DNS server in the current article, we only review the DNS
records that relate to the Autodiscover services.
The DNS records that make the magic is, a simple CNAME record that created for
redetect Autodiscover client requests to an Office 365 element that will
impersonate himself to the real host that they are looking for.
Page 8 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Page 9 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
For example, in the public DNS server who host the domain name o365info.com,
we will add a new CNAME record that will cause the DNS server to provide the IP
address of the hostautodiscover.outlook.com to each DNS client that will ask for the
IP address ofautodiscover.outlook.com
For example, when an Autodiscover client tries to communicate with a host named
autodiscover.o365info.com, the IP address that will be returned to the Autodiscover
client from the DNS will lead the Autodiscover client to the Office 365 hosts
named autodiscover.outlook.com.
Who is autodiscover.outlook.com?
Page 10 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
The Autodiscover flow of Office 365 users (users whom their mailbox is hosted at
Exchange Online) starts by communicating with the Office 365 hosts named
autodiscover.outlook.com
The autodiscover.outlook.com component, will accept the Autodiscover clients
requests, but, instead of proving the required Autodiscover information, the
host autodiscover.outlook.com, send as a reply, a redirection message to lead the
Autodiscover client to -other Offices 365 Autodiscover Endpoints.
autodiscover.o365info.com a single host or logical components. Theoretically, the
Office 365 objects that redirect Autodiscover Endpoint to their required Exchange
Online server is a single host named autodiscover.o365info.com.
In reality, the autodiscover.outlook.com is just a logical object that is represented by
Dozens or even hundreds server which are scattered around the world.
When an Autodiscover client tries to get the IP address of the hostname
autodiscover.outlook.com, the answer (the IP address + host name) that the
Autodiscover client will get, depend on his Geographic location.
For example, an Autodiscover client that is physically located in Europe will get a
specific information that is different from Autodiscover client that is physically
located in the USA.
Page 11 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
In case that you are wondering why do we see the host nameautodiscover-emeaeast.outlook.com instead of the host name that we talk about
autodiscover.outlook.com, the answer that its probably because the Office 365 DNS
infrastructure is based on a GeoDNS.
When using the option of GeoDNS, the DNS server recognizes the IP address of the
DNS client and concludes what is the geographic location of the DNS client.
Based on this information, the DNS servers to provide an answer (IP address and
hostname) that is suitable to the DNS client geographic location.
In our example, my physical location considered as EMEA (Europe, Middle East
and Africa) and for this reason, the Office 365 Autodiscover component that will be
used is a host who is physically located in EMEA.
Page 12 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Page 13 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
additional redirection but this time, the redirection method is based on the HTTPS
protocol.
Page 14 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Autodiscover flow in an Office 365 environment | Part 2#3 | Part 30#36, we review
thoroughly each of these steps.
In the following diagram, we can see a high-level view of the elements that
Autodiscover client will meet on his way.
I have to position the DNS server at the top of the diagram because, each time that
the Autodiscover client will be redirected to the next hop, the Autodiscover client
will need to create a DNS query asking for the IP address of the hostname who
appear in the redirection message.
Page 15 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Page 16 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Phase 1
As mention before, in our scenario, the Autodiscover client looks for a host named
autodiscover.o365info.com
The answer of the DNS will provide the Autodiscover client the IP address of the
hostautodiscover.outlook.com
The Autodiscover client will try to communicate (using HTTPS) with this host.
The host autodiscover.outlook.com, cannot communicate using HTTPS because he
is not the real Autodiscover Endpoint and, he doesnt have a server certificate that
includes the host name autodiscover.o365info.com
Because the HTTPS communication test fails, the Autodiscover client will create a
new HTTP request asking for a redirection to the required Autodiscover Endpoint,
that can provide the required Autodiscover services using the HTTPS protocol.
Page 17 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Phase 2
The Autodiscover client tries to communicate the new Autodiscover Endpoint
(autodiscover-s.outlook.com) using HTTPS protocol.
The good news is that the host autodiscover.outlook.com can communicate using
HTTPS, but the less good news is, that the autodiscover.outlook.com public certificate
includes an authorization only for hosts names who belong to the outlook.com
domain.
The Autodiscover client is expecting to find in the server certificate the host name
autodiscover.o365info.com and this expectation cannot be fulfilled because in the
Office 365 environment, there is no mechanism that provides a dedicated public
certificate for each of the Office 365 tenant public domain name.
So now we have a problem.
The Autodiscover client cannot complete the process because he cannot find the
host nameautodiscover.o365info.com in the server certificate and technically the
Autodiscover process should fail.
Page 18 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
And the good news is that the Autodiscover method has a trick named HTTPS
redirection.
The Autodiscover Endpoint autodiscover.outlook.com cannot meet the conditions
of the Autodiscover client, but because the
autodiscover.outlook.com can prove his identity by providing the client his certificate,
the Autodiscover client can trust the host
autodiscover.outlook.com and relate to him as a reliable source of information.
The information that the autodiscover.outlook.com provide to the Autodiscover
client is not the Autodiscover information (the Autodiscover configuration settings)
but instead, the information includes a redirection to additional Autodiscover
Endpoint.
The additional Autodiscover Endpoint is the Exchange Online CAS server that will
be able to provide the Autodiscover client the required Autodiscover information.
In our specific scenario, the information that is provided
by autodiscover.outlook.com (the XML redirection message) includes the name of the
following host pod5149.outlook.com
Note the name of the Exchange Online CAS server in our scenario is
pod51049.outlook.com
Technically, the name can and will be changed based on many factors such as the
Page 19 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
office 365 data centers in which the Office 365 tenant is hosted, the available
Exchange Online CAS servers and so on.
Phase 3
Autodiscover client is willing to accept the redirection information and try to
communicate with the Autodiscover Endpoint pod51049.outlook.com
The good news is that now the Autodiscover process can be successfully
completed.
The public certificate that the pod51049.outlook.com provides, is a wild-card
certificate that includes an authorization for all the host names under
the outlook.com domain name.
The Autodiscover client will get the pod51049.outlook.com certificate, validate that
the certificate was provided from a trusted CA, verify the host name or the domain
name (in our scenario outlook.com) appears in the public certificate.
This is a sign for the Autodiscover client that now, he can safely provide his
identity to the server by providing the Office 365 user credentials.
After the completion of the mutual authentication process, a secure
communication link is created and the server (pod5149.outlook.com) provide to the
Autodiscover client the desired autodiscover.xml file.
Page 20 of 20 | Autodiscover flow in an Office 365 environment | Part 1#3 | Part 29#36
Additional reading