title: Okta as IDP in Azure AD
body: <p>We need to configure okta as IDP for azure ad applications. For example: When a user tries to access the enterprise application, they'll be challenged with a login page, which will be validated by OKTA. Post this authentication, the authorization will be handled by Azure and upon successful authorization, user will be shown a landing page of the application.</p>
  <p>We have referred below links as reference for setup:</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/active-directory/b2b/direct-federation" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory/b2b/direct-federation</a>
  <a href="https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp</a>
  <a href="https://developer.okta.com/docs/guides/custom-url-domain/overview/" rel="nofollow noreferrer">https://developer.okta.com/docs/guides/custom-url-domain/overview/</a></p>
  <p>What we did so far?</p>
  <ol>
  <li>Registered company &quot;example.com&quot; in okta. By default okta configures it as &quot;example.okta.com&quot;</li>
  <li>Registered custom domain &quot;id.example.com&quot;. Our okta instance is accessible using this domain</li>
  <li>Created an enterprise SAML app (which also exist in Azure AD) in OKTA</li>
  <li>Exported OKTA IDP metadata</li>
  </ol>
  <p>Now, we are trying to import this IDP metadata as external identity provider in AAD. But it fails with below error, if we map example.com or id.example.com as domain name of federating idp. Because of these errors we’re unable to setup the custom domain of federated IDP(OKTA). <em><strong>Please assist us on the approach for the same.</strong></em></p>
  <p>Error Messages:</p>
  <p>For domain as &quot;id.example.com&quot;
  Failed to add a SAML/WS-Fed identity provider.This direct federation policy does not pass one or more requirements. Go to aka.ms/b2b-direct-fed to learn more.</p>
  <p>For domain as &quot;example.okta.com&quot;
  Failed to add a SAML/WS-Fed identity provider.This direct federation configuration is currently not supported. The authentication URL must match the domain for direct federation or be one of the allowed domains. Go to aka.ms/b2b-direct-fed to learn more.</p>