Exchange Hybrid (Teams Calendar missing)

BF 96 Reputation points
2021-10-29T15:54:50.713+00:00

Hi everybody,

we are trying to get the Teams Calendar Icon back while still using our on prem 2016 Exchange.
We had this working for over a year and about a month ago it stopped working.
We are Using Exchange 2016 Cu22 and O365 with Microsoft 365 Business Basic Licenses.

While it was working we only hat Azure AD Synch in place but it seems Exchange Hybrid Configuration is needed now.
So we setup Hybrid with the latest Hybrid Configuration Wizard
(https://learn.microsoft.com/en-us/exchange/hybrid-deployment/deploy-hybrid)
This worked well and without any issues, however, the calendar icon is still missing.

Digging around we found the following:

  • The Test at https://testconnectivity.microsoft.com/tests/TeamsCalendarMissing/input failed with "User mailbox is marked as undiscoverable by Teams middle-tier service." and Teams Logs show "isMailboxDiscoverable: false"
  • Autodiscoverv2 is working fine
  • Oauth test from On-Prem to Cloud is coming back with "Success" (local Exchange Shell: Test-OAuthConnectivity -Service EWS -TargetUri https://outlook.office365.com/ews/exchange.asmx -Mailbox <On-Premises Mailbox> -Verbose | Format-List)
  • Oauth test from Cloud to On-Prem failes with "Error:[OAuthCredentials:Authenticate] the authorization header was 'Bearer', but no challenge returned from 'https://something.domain.de/ews/Exchange.asmx'. That url may not support OAuth" (Online Exchange Shell: Test-OAuthConnectivity -Service EWS -TargetUri <external hostname authority of your Exchange On-Premises deployment>/metadata/json/1 -Mailbox <Exchange Online Mailbox> -Verbose | Format-List)

We already had an call open with O365 Support, but cause of the Oauth Issue they told us that it is an Exchange Issue and the cant help us with that.
The support suggested to reassign the O365 Licenses, but this doesn't fixed the issue.

We also tried to verify the steps on https://learn.microsoft.com/en-us/exchange/configure-oauth-authentication-between-exchange-and-exchange-online-organizations-exchange-2013-help but cannot find any issue here. The EvoSTS Server is created and the Organization connector is also in place.

We still not sure if the Oauth Error is the cause or if there is any other issue but below you will find the complete error. The only thing we noticed here is that it received a Basic realm as challenge which seems not correct if we check other reply's on several posts.

Test-OAuthConnectivity -Service EWS -TargetUri https://something.domain.de/metadata/json/1 -Mailbox online@keyman .de -Verbose | Format-List

RunspaceId : fc5dfa2a-dc26-4bd5-86c3-XXXXXXXXXXXX
Task : Checking EWS API Call Under Oauth
Detail : Die Konfiguration wurde zum letzten Mal erfolgreich geladen um 01.01.0001 00:00:00 UTC. Dies war vor 1062851924 Minuten.
Der Tokencache wird geleert, weil "zwischengespeichertes Token verwenden" auf "false" festgelegt ist.
Oauth-Protokoll für ausgehende Exchange-Nachrichten:
Clientanforderungs-ID: f51375a6-3d3a-44b2-b100-XXXXXXXXXX
Information:[OAuthCredentials:Authenticate] entering
Information:[OAuthCredentials:Authenticate] challenge from 'https://something.domain.de/ews/Exchange.asmx' received: Basic realm="something.domain.de"
Error:[OAuthCredentials:Authenticate] the authorization header was 'Bearer', but no challenge returned from 'https://something.domain.de/ews/Exchange.asmx'. That url may not support OAuth

          Exchange-Antwortdetails:  
          HTTP-Antwortnachricht:  
          Ausnahme:  
          System.Net.WebException: The request was aborted: The request was canceled. ---> Microsoft.Exchange.Security.OAuth.OAuthTokenRequestFailedException: The specified url may not support OAuth.  
             at Microsoft.Exchange.Security.OAuth.OAuthCredentials.Authenticate(String challengeString, WebRequest webRequest, Boolean preAuthenticate)  
             at System.Net.AuthenticationManager2.Authenticate(String challenge, WebRequest request, ICredentials credentials)  
             at System.Net.AuthenticationState.AttemptAuthenticate(HttpWebRequest httpWebRequest, ICredentials authInfo)  
             at System.Net.HttpWebRequest.CheckResubmitForAuth()  
             at System.Net.HttpWebRequest.CheckResubmit(Exception& e, Boolean& disableUpload)  
             at System.Net.HttpWebRequest.DoSubmitRequestProcessing(Exception& exception)  
             at System.Net.HttpWebRequest.ProcessResponse()  
             at System.Net.HttpWebRequest.SetResponse(CoreResponseData coreResponseData)  
             --- End of inner exception stack trace ---  
             at System.Net.HttpWebRequest.GetResponse()  
             at Microsoft.Exchange.Monitoring.TestOAuthConnectivityHelper.SendExchangeOAuthRequest(ADUser user, String orgDomain, Uri targetUri, String& diagnosticMessage, Boolean appOnly, Boolean useCachedToken,  
          Boolean reloadConfig)  

ResultType : Error
Identity : Microsoft.Exchange.Security.OAuth.ValidationResultNodeId
IsValid : True
ObjectState : New

Thanks for any information or guidance you can provide.

regards

Exchange | Hybrid management
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

Accepted answer
  1. BF 96 Reputation points
    2021-11-12T22:54:36.627+00:00

    With thanks to @Kael Yao we found the issue and the Teams Calendar is working.
    However, the above Error Message with Oauth is still the same, so we still don't know whats wrong here but it seems not necessary.

    The resolution:
    We are using Sonicwall SMA with WAF (Web Application Firewall). The WAF does update its heuristics automatically and one of them (Suspicious Authorization Header) seems to be updated and was blocking the request from O365.
    Additional to this issue the global exclusions, which has been created, doesn't work.
    Today we got a reply from the Sonicwall Support with a workaround by setting the exclusion not globally but on the rule itself.

    Result
    -The Teams Calendar test on https://testconnectivity.microsoft.com is working
    -The free busy test on https://testconnectivity.microsoft.com is working
    -The Teams Calendar in Teams is visible and working
    -Oauth test still failes with the error "The specified url may not support OAuth."

    regards

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. BF 96 Reputation points
    2021-11-07T15:42:37.917+00:00

    Just to add an update here:

    As the only thing you can find is basically to create the Oauth Setup Manually we tried this also.
    So we deleted and recreated the configuration like described here https://learn.microsoft.com/de-de/exchange/configure-oauth-authentication-between-exchange-and-exchange-online-organizations-exchange-2013-help.

    The only difference we noticed is that HCW uses AuthMetadataUrl "https://accounts.accesscontrol.windows.net/7b85e921-3452-4ddc-a14b-77xxxxxxxxxx/metadata/json/1" and "https://autodiscover-s.outlook.com/autodiscover/autodiscover.svc" as IntraOrganizationConnecter while the manual uses "https://login.microsoftonline.us/domain.mail.onmicrosoft.com/metadata/json/1" and "https://outlook.office365.com/autodiscover/autodiscover.svc"

    However, after this has been finished the issue is exactly the same. So it seems Oauth is not really the issue here but something else.
    So far the Eventlog was not helpful and we are still searching for any hint what went wrong here.

    regards

    0 comments No comments

  2. BF 96 Reputation points
    2021-11-07T17:01:18.403+00:00

    Just to check this also, should the webpage https://something.domain.de/metadata/json/1 show anything if opened from external source?
    Because if we try it just shows a white page and if we try from internal with https://exchangeFQDN/metadata/json/1 or https://localhost/metadata/json/1 it just shows webpage not found.

    But if i open https://something.domain.de/autodiscover/metadata/json/1 from external or internal with https://exchangeFQDN/autodiscover/metadata/json/1 i get some text.

    However, if i try the test with this url it still got the same issue:

    Test-OAuthConnectivity -Service EWS -TargetUri https://remote.expopartner.de/autodiscover/metadata/json/1 -Mailbox ******@expopartner.de -Verbose | Format-List

    Creating a new Remote PowerShell session using Modern Authentication for implicit remoting of "Test-OAuthConnectivity" command ...

    RunspaceId : a73ef744-9fd4-41fb-8172-f24XXXXXXX
    Task : Checking EWS API Call Under Oauth
    Detail : Die Konfiguration wurde zum letzten Mal erfolgreich geladen um 01.01.0001 00:00:00 UTC. Dies war vor 1062865035 Minuten.
    Der Tokencache wird geleert, weil "zwischengespeichertes Token verwenden" auf "false" festgelegt ist.
    Oauth-Protokoll für ausgehende Exchange-Nachrichten:
    Clientanforderungs-ID: ce3ce26b-8365-475c-b19a-6e3XXXXXXXXX
    Information:[OAuthCredentials:Authenticate] entering
    Information:[OAuthCredentials:Authenticate] challenge from 'https://something.domain.de/ews/Exchange.asmx' received: Basic realm="something.domain.de"
    Error:[OAuthCredentials:Authenticate] the authorization header was 'Bearer', but no challenge returned from 'https://something.domain.de/ews/Exchange.asmx'. That url may not support OAuth

              Exchange-Antwortdetails:
              HTTP-Antwortnachricht:
              Ausnahme:
              System.Net.WebException: The request was aborted: The request was canceled. ---> Microsoft.Exchange.Security.OAuth.OAuthTokenRequestFailedException: The specified url may not support OAuth.
                 at Microsoft.Exchange.Security.OAuth.OAuthCredentials.Authenticate(String challengeString, WebRequest webRequest, Boolean preAuthenticate)
                 at System.Net.AuthenticationManager2.Authenticate(String challenge, WebRequest request, ICredentials credentials)
                 at System.Net.AuthenticationState.AttemptAuthenticate(HttpWebRequest httpWebRequest, ICredentials authInfo)
                 at System.Net.HttpWebRequest.CheckResubmitForAuth()
                 at System.Net.HttpWebRequest.CheckResubmit(Exception& e, Boolean& disableUpload)
                 at System.Net.HttpWebRequest.DoSubmitRequestProcessing(Exception& exception)
                 at System.Net.HttpWebRequest.ProcessResponse()
                 at System.Net.HttpWebRequest.SetResponse(CoreResponseData coreResponseData)
                 --- End of inner exception stack trace ---
                 at System.Net.HttpWebRequest.GetResponse()
                 at Microsoft.Exchange.Monitoring.TestOAuthConnectivityHelper.SendExchangeOAuthRequest(ADUser user, String orgDomain, Uri targetUri, String& diagnosticMessage, Boolean appOnly, Boolean useCachedToken, Boolean reloadConfig)
    

    ResultType : Error
    Identity : Microsoft.Exchange.Security.OAuth.ValidationResultNodeId
    IsValid : True
    ObjectState : New

    0 comments No comments

  3. Kato Mihai 1 Reputation point
    2023-07-11T10:20:06.7133333+00:00

    This worked for us (definitely was not removed by the Teams Admin in the admin panel) and EWS settings on Exchange Online were never changed/customized.

    Get-organizationconfig | fl ews*

    EwsAllowEntourage:

    EwsAllowList:

    EwsAllowMacOutlook:

    EwsAllowOutlook:

    EwsApplicationAccessPolicy:

    EwsBlockList:

    EwsEnabled:

    Environment:

    Exchange Hybrid

    Mailboxes in Exchange Online

    [FIXED] - Use the Teams Web App once

    1. Open **Teams web **app 
    2. Sign-in to Teams
    3. Restart Teams desktop app

    I know, is an easy fix, but nobody thought that this might impact the Teams desktop client.

    Other solutions we've tried:

    Delete Teams Cache

    1. Fully close Teams app (or Kill Teams process)
    2. Delete all teams cache 
    • Open File Explorer → Paste in this path:  %appdata%\Microsoft\Teams
    • Delete all files 
    1. Start Teams again

    Delete files in AAD Plugin broker path:

    1. %username%\AppData\Local\Packages\Microsoft.AAD.BrokerPlugin_**********\AC\TokenBroker\Accounts
    2. Restart laptop

    Empty Credentials manager 

    1. Go to Start → Credentials Manager 
    2. Windows Credentials
    3. Delete /remove all credentials from Teams or Office or OneDrive.
    4. Restart laptop

    Update Teams app 

    1.  Open Teams
    2. On Top click on the 3 dots icon 
    3. Select "Check for updates"
    4. Restart laptop

    Test the connectivity 

    https://testconnectivity.microsoft.com/tests/TeamsCalendarMissing/input

    P.S. could be also that all affected users had MFA enabled on Office Apps (via Conditional Access) which might have caused this "glitch" in the MS matrix.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.