Free Busy issue - Office 365 to On-premises - OAuth

RndMaster 116 Reputation points
2021-02-03T19:59:53.497+00:00

Free Busy not working from O365 to on-premises (one way). Can anyone help with suggestions or have experienced such issue? Autodiscover failed for email address User.xyz@jaswant .com with error System.Net.WebException: The request failed with HTTP status 401: Unauthorized.\r\n at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)\r\n at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)\r\n at Microsoft.Exchange.SoapWebClient.AutoDiscover.DefaultBinding_Autodiscover.EndGetUserSet…cover.DefaultBinding_Autodiscover.EndGetUserSettings(IAsyncResult asyncResult)\r\n at Microsoft.Exchange.InfoWorker.Common.Availability.SoapAutoDiscoverRequest.[]c__DisplayClass48_0.[EndInvoke]b__0()\r\n at Microsoft.Exchange.InfoWorker.Common.Availability.SoapAutoDiscoverRequest.ExecuteAndHandleException(ExecuteAndHandleExceptionDelegate operation), diagnostics: *2000003;reason=\"The hostname component of the audience claim value 'https://mail.abc.com' is invalid*";error_category=\"invalid_resource\"", ResponseCode: "ErrorAutoDiscoverFailed", …

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,166 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,335 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,875 questions
{count} votes

Accepted answer
  1. RndMaster 116 Reputation points
    2021-02-06T00:51:09.207+00:00

    Issue Resolved. I had to disable OAuth in Office 365 by running the following PowerShell in Exchange Online:
    Get-IntraOrganizationConnector| Set-IntraOrganizationConnector -Enabled $false

    Confirmed that TargetApplicationUri, TargetSharingEpr, TargetAutodiscoverEpr are configured in Exchange Online.
    Get-OrganizationRelationship | Set-OrganizationRelationship -TargetSharingEpr https://mail.abc.com/ews/exchange.asmx -TargetAutodiscoverEpr https://autodiscover.abc.com/autodiscover/autodiscover.svc/WSSecurity

    Enabled the Federation Trust in Exchange On-premises as it was not enabled by hybrid wizard (Exchange Admin center > Organization)

    Added the abc.com in Exchange On-premises "Organization Sharing".

    wait 5 mins and Free Busy started working both ways.

    OAuth sucks..


1 additional answer

Sort by: Most helpful
  1. Lucas Liu-MSFT 6,161 Reputation points
    2021-02-04T06:52:30.953+00:00

    Hi @PriyavertSharma-0904 ,
    I agree with what Andy said.
    Are there any errors after you deploy the hybrid environment?
    Please run the following command to verify that the OAuth configuration is correct:

    Test-OAuthConnectivity -Service EWS -TargetUri https://outlook.office365.com/ews/exchange.asmx -Mailbox <On-Premises Mailbox> -Verbose | Format-List  
    

    Please run the following command to check the url and AuthenticationMethods of EWS’s virtual directory.

    Get-WebServicesVirtualDirectory | fl *auth*,*url*  
    

    According to my inspection in the laboratory environment, by default, "Autodiscvoer" and "EWS" have both checked "Require SSL".
    Looking forward to your feedback.

    ----------

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments