Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

Posted on by 290

Hello Guys,

I have been trying to connect Dynamics 365 (online) to Exchange Server (on-premises) based on (https://technet.microsoft.com/en-us/library/mt622059.aspx)but without any luck. Please check the screenshot.

Here are the things that are already done:

- user is created with ApplicationImpersonation role,

- we have HTTPS secured connection,

- I can access user's mailbox via Online Web app and easily send emails,

- I can access https://<Server>/EWS/Exchange.asmx with the user mentioned above,

- BasicAuthentication: True on OWA.

I have no idea what can I do next. Can you help me please?

BR,

Miha

Test-failed.PNG

Log:

*********************
Message from 365::
*********************
Aquiring Token from ACS has failed. Please check if your tenantId is specified correctly in your Email Server Profile, and make sure your Exchange and CRM are under the same tenant
*****************************
Request to Exchange::
*****************************
<Trace Tag="EwsRequestHttpHeaders" Tid="945" Time="2017-09-22 10:11:10Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.1076.004
Accept-Encoding: gzip,deflate


</Trace>
<Trace Tag="EwsRequest" Tid="945" Time="2017-09-22 10:11:10Z" Version="15.00.1076.004">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:m="schemas.microsoft.com/.../messages" xmlns:t="schemas.microsoft.com/.../types" xmlns:soap="schemas.xmlsoap.org/.../envelope">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>xxxxxxx</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:FindFolder Traversal="Shallow">
<m:FolderShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:FolderShape>
<m:IndexedPageFolderView MaxEntriesReturned="1" Offset="0" BasePoint="Beginning" />
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="inbox" />
</m:ParentFolderIds>
</m:FindFolder>
</soap:Body>
</soap:Envelope>
</Trace>

*****************************
Response from Exchange:
*****************************
<Trace Tag="EwsResponseHttpHeaders" Tid="945" Time="2017-09-22 10:11:10Z">
HTTP/1.1 401 Unauthorized
request-id: 3d406841-e4ef-49a9-8b68-e1fff214c0dc
Server: Microsoft-IIS/8.5
WWW-Authenticate: Negotiate,NTLM,Basic realm="xxxxxxxxx.xx"
X-Powered-By: ASP.NET
X-FEServer: LPEXC01
Date: Fri, 22 Sep 2017 10:11:09 GMT
Connection: close
Content-Length: 0


</Trace>

*This post is locked for comments

  • Suggested answer
    Marra mi au Profile Picture
    Marra mi au 5 on at
    RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    Hello everyone.

    fixed changing upn in active directory to match email address

    Regards.

  • AndreaP Profile Picture
    AndreaP on at
    RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    I' ve the same problem in an Dynamics365 Online and Exchange 2010 On Premise. 

    All seems to be configured (basic auth, impersonification, ecc. ecc.). 

    All is ok with connectivity and tests. But the profile log error "basic auth not configured".

  • RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    hi,

    did you already find the solution for this issue? I get similar error message, 
    although throw test with the https://testconnectivity.microsoft.com/ wasn't any errors. 

    And for sure there is no issue with the wrong password or user.

    Do we need extra mailbox in Exchange Online?

     

    *********************

    Message from 365::

    *********************

    The remote server returned an error: (401) Unauthorized. Please make sure the user name and password is correct, and try again.

    *****************************

    Request to Exchange::

    *****************************

  • ShawnMT Profile Picture
    ShawnMT on at
    RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    Yes, we ensured only Basic Configuration was on. We have tried about every option imaginable and still get the same error.

  • Chadi Tannous Profile Picture
    Chadi Tannous 1,037 on at
    RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    Can u make sure that only basic authentication is configured on iis

  • ShawnMT Profile Picture
    ShawnMT on at
    RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    I am having the same issue and I have went thru the TechNet instructions multiple times ensuring all prerequisites have been met. 

    If you got this issue resolved could you please post your resolution? 

    Thank You. 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: HTTP/1.1 401 Unauthorized - test Failed: Connect Connect Dynamics 365 (online) to Exchange Server (on-premises)

    Hi,

    I have the same problem,

    however no basic auth on OWA, basic auth on EWS front end.

    <Trace Tag="EwsResponseHttpHeaders" Tid="600" Time="2017-09-27 09:24:13Z">

    HTTP/1.1 401 Unauthorized

    Pragma: no-cache

    Content-Length: 13

    Cache-Control: no-cache,no-store

    Content-Type: text/html

    WWW-Authenticate: Basic realm=test.domain.com, encoding="UTF-8"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans