Recently I ran into an issue with a customer attempting to update their MetadataExchangeURI for their Federation settings, however when running the necessary cmdlets they noticed the MetadataExchangeURI would not update. As a result this was preventing the admin from completing the setup for federating their domain. You may run into this issue if you are trying to federate your domain using a third-party IDP for federation such as PingFederate, Okta, Centrify, Shibboleth, etc.
We did some testing today, and we found that we had to set the domain back to managed in order to get the MetadataExchangeURI to update. The cause appears to be that even though the MetadataExchangeURI is updated in Microsoft’s MSODS system, it still returns the old value in Microsoft's OrgID system. OrgID does not successfully update the value because when the protocol is set to SAMLP, no updates to the MetadataExchangeURI are allowed. OrgID is a legacy authentication platform first used with live accounts. It is no longer servicing authentication but has not yet been completely decoupled from AAD. As a result this type of inconsistency between the two services will cause issues. Thus we ran some additional test, and subsequently found a workaround to update the MetadataExchangeURI as WSFed, then change the domain to managed, and federate again with the correct values using SAMLP.
Steps to resolve are as follows:
First, Set your values to what you want it to be using a variable.
$domainName = "Davengers.us"
$BrandName = "ADFS"
$browserSSOLoginURL = "https://adfs.davengers.us/adfs/services/trust/2005/usernamemixed"
$logoutURL = "https://adfs.davengers.us/adfs/ls/"
$issuerProviderID = "http://davengers.us/adfs/services/trust/"
$idpSigningCert = "[insert cert info]"
$MetadataURL = "https://newvalue/adfs/services/trust/mex"
$ssoProtocol = "SAMLP"
Steps to resolve are as follows:
- Open Windows Azure Active Directory PowerShell and connect to the MSOL service.
- Confirm if the domain is currently set to managed or federated.
- Set the domain back to managed.
- Set-MsolDomainAuthentication -DomainName $domainame -Authentication Managed
- Federate the domain as WSFed, with the correct URL’s.
- Set-MsolDomainAuthentication -DomainName $domainName -FederationBrandName $BrandName -Authentication Federated -PassiveLogOnUri $browserSSOLoginURL -SigningCertificate $idpSigningCert -IssuerUri $issuerProviderID -LogOffUri $logoutURL -PreferredAuthenticationProtocol WSFed -MetadataExchangeUri $MetadataURL
- Set the domain back to managed. There may be a 1-2 minute replication if you get an error.
- Set-MsolDomainAuthentication -DomainName $domainName -Authentication Managed
- Federate the domain as SAMLP with all the correct URL’s.
- Set-MsolDomainAuthentication -DomainName $domainName -FederationBrandName $BrandName -Authentication Federated -PassiveLogOnUri $browserSSOLoginURL -SigningCertificate $idpSigningCert -IssuerUri $issuerProviderID -LogOffUri $logoutURL -PreferredAuthenticationProtocol SAMLP -MetadataExchangeUri $MetadataURL
- View the results and confirm everything is set as expected.
- Get-MsolDomainFederationSettings -domainName $domainName | FL
Thanks to Dragos C. and John K. For assistance in writing and editing the article.