Version Affected: All
Overview
This article explains how to federate a Microsoft Entra ID domain with SecureAuth Identity Provider (IdP) using the Microsoft Graph PowerShell module. Microsoft has retired the MSOnline (MSOL) PowerShell module, so it can no longer be used to configure federation.
You need an account that can manage domains in the Microsoft Entra tenant, and a SecureAuth IdP realm set up to handle WS-Federation sign-ins for the domain.
Federate the Domain
First, collect these values from the SecureAuth IdP realm. In each URL, replace <idp-host> with the IdP's host name and <N> with the realm number.
- Passive sign-in URL: the realm's URL, https://<idp-host>/SecureAuth<N>/
- Active sign-in URL: the realm's WS-Trust endpoint, https://<idp-host>/SecureAuth<N>/webservice/wstrust.svc/2005/usernamemixed
- Metadata exchange URL: https://<idp-host>/SecureAuth<N>/webservice/wstrust.svc/mex
- Issuer: the issuer the realm puts in its tokens, for example, https://<idp-host>/SecureAuth<N>. It must match the realm's issuer exactly.
- Sign-out URL: https://<idp-host>/SecureAuth<N>/wsfedsignout.aspx
- Signing certificate: the public certificate the realm signs its tokens with, as one line of Base64. Export it in Base-64 encoded X.509 (.CER) format, and then copy the text between the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines and remove the line breaks.
Then, in PowerShell:
- Install the Microsoft Graph PowerShell module, if it isn't already installed:
Install-Module Microsoft.Graph -Scope CurrentUser - Sign in to Microsoft Graph with the permissions this needs:
Connect-MgGraph -Scopes "Domain.ReadWrite.All","Directory.AccessAsUser.All" - Set the variables, replacing each placeholder with the values you collected:
$url = "https://<idp-host>/SecureAuth<N>/" $ura = "https://<idp-host>/SecureAuth<N>/webservice/wstrust.svc/2005/usernamemixed" $metadata = "https://<idp-host>/SecureAuth<N>/webservice/wstrust.svc/mex" $uri = "https://<idp-host>/SecureAuth<N>" $logouturl = "https://<idp-host>/SecureAuth<N>/wsfedsignout.aspx" $cert = "<signing-certificate-base64>" - Federate the domain, replacing <domain> with the domain name and <display-name> with a name for the federation configuration:
New-MgDomainFederationConfiguration -DomainId "<domain>" -DisplayName "<display-name>" -PassiveSignInUri $url -ActiveSignInUri $ura -MetadataExchangeUri $metadata -IssuerUri $uri -SignOutUri $logouturl -SigningCertificate $cert -PreferredAuthenticationProtocol "wsFed" -FederatedIdpMfaBehavior "acceptIfMfaDoneByFederatedIdp" - Check the result. Get-MgDomain should show the domain's AuthenticationType as Federated, and Get-MgDomainFederationConfiguration shows the values you set:
Get-MgDomain -DomainId "<domain>" Get-MgDomainFederationConfiguration -DomainId "<domain>"
Roll Back to Managed Authentication
To return the domain to managed authentication, run this command, replacing <domain> with the domain name:
Update-MgDomain -DomainId "<domain>" -AuthenticationType "Managed"
Special Considerations
After you switch a domain from Managed to Federated, wait at least an hour for the change to replicate before you roll it back.
SecureAuth Knowledge Base Articles provide information based on specific use cases and may not apply to all appliances or configurations. Be advised that these instructions could cause harm to the environment if not followed correctly or if they do not apply to the current use case.
Customers are responsible for their own due diligence prior to utilizing this information and agree that SecureAuth is not liable for any issues caused by misconfiguration directly or indirectly related to SecureAuth products.
Comments
0 comments
Please sign in to leave a comment.