Share via

New-MgDomainFederationConfiguration - Insufficient privileges to complete the operation.

Biswajit Biswas 20 Reputation points
2025-11-12T04:39:05.03+00:00

Getting 403 but I have Global Admin & passing Connect-MgGraph -Scopes "Domain.ReadWrite.All","Directory.ReadWrite.All"

New-MgDomainFederationConfiguration_CreateExpanded: Insufficient privileges to complete the operation.

# ============================
#  Entra ID Federation Setup
#  IdP: Okta (SAML Federation)
# ============================

# --- Variables (sanitize and customize) ---
$domain        = "<your-verified-domain>"                  # e.g., corp.example.com
$issuer        = "http://www.okta.com/<okta-app-id>"       # From Okta SAML metadata (EntityID)
$signInUrl     = "https://<okta-tenant>.okta.com/app/<okta-app-name>/<okta-app-id>/sso/saml"
$metadataUrl   = "https://<okta-tenant>.okta.com/app/<okta-app-id>/sso/saml/metadata"
$signOutUrl    = "https://<okta-tenant>.okta.com"
$certBase64    = "<base64-signing-certificate-from-okta>"   # Extracted from Okta metadata

# --- Create Federation Configuration in Entra ID ---
New-MgDomainFederationConfiguration `
  -DomainId $domain `
  -DisplayName "Okta_IDP" `
  -IssuerUri $issuer `
  -ActiveSignInUri $signInUrl `
  -MetadataExchangeUri $metadataUrl `
  -SignOutUri $signOutUrl `
  -SigningCertificate $certBase64 `
  -FederatedIdpMfaBehavior "acceptIfMfaDoneByFederatedIdp" |
  Format-List

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

Answer recommended by moderator

Biswajit Biswas 20 Reputation points
2025-11-12T06:13:51.89+00:00

Fixed with Directory.AccessAsUser.All

 Connect-MgGraph -Scopes "Domain.ReadWrite.All","Directory.ReadWrite.All", "Directory.AccessAsUser.All" 

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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