<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Microsoft Office 365 Error in Okta "Could not remove the domain federation with Office 365; please retry removing the federation for this domain after a few hours."
Single Sign-On
Okta Classic Engine
Okta Identity Engine
Overview

This article explains the following error that occurs when attempting to change the sign-on method to Secure Web Authentication (SWA) in the Microsoft Office 365 application:

 

Please review the form to correct the following error(s):Could not remove the domain federation with Office 365; please retry removing the federation for this domain after a few hours.

 

Applies To
  • Okta Classic Engine
  • Okta Identity Engine (OIE)
  • Microsoft Office 365
  • WS-Federation (WS-Fed)
  • Secure Web Authentication (SWA)
Cause

The error occurs because Okta attempts to access the federation object in Microsoft using the stored credentials of the Global Admin account. The process fails if the password has expired or the account has been removed.

Solution

If the Microsoft Office 365 application is configured for Automatic Federation in Okta, perform the following steps to resolve the error and finish the de-federation from the Okta User Interface (UI):

  1. Navigate to Applications > Office 365 > Sign On in the Okta Admin Console.
  2. Select Start federation setup under the Office 365 Domains section to grant Okta the necessary Microsoft Graph API permissions to manage federation.

Office 365 Domains

 

If the application is configured for Manual Federation, Okta cannot modify the federation settings in Microsoft. Use the Microsoft Graph module via PowerShell instead, as detailed in How to Use PowerShell to Disable Manual Federation Between Okta and Microsoft Office 365:

  1. Install the Microsoft Graph module on a Windows device using the Microsoft Graph Installation Guide.
  2. Run the following PowerShell commands, replacing <DomainName> in both places with the federated domain name (for example, acme.com):
    1. Connect-MgGraph -Scopes Directory.AccessAsUser.All
    2. Remove-MgDomainFederationConfiguration -DomainId <DomainName> -InternalDomainFederationId (Get-MgDomainFederationConfiguration -DomainId <DomainName> | Select -Property Id).id
  3. Deactivate and delete the Office 365 application in Okta once Microsoft users are no longer redirected to Okta for authentication.

 

Related References

Loading
Microsoft Office 365 Error in Okta "Could not remove the domain federation with Office 365; please retry removing the federation for this domain after a few hours."