title: Can I add a Scoping element to the authentication request sent to a SAML2 identity provider from Azure AD B2C custom policies?
body: <p>We're trying to set up an Azure AD B2C tenant to use a SAML2 Identity Provider for external identities using Custom Policies. Since this identity provider itself also acts as a hub for several other identity providers, they support the use of the SAML2 Scoping element to direct the user to the appropriate &quot;downstream&quot; identity provider immediately. This is useful, because in some cases we can predict which identity provider to send the user to, in order to prevent them from signing in incorrectly. It also eliminates an action from the log in process for the user, since they do not have to specify which identity provider they wish to use themselves.</p>
  <p>We have succeeded in setting up basic SAML2 integration with the identity provider using the available samples and documentation for Azure AD B2C. However, I have been unable to find whether this Scoping element is directly supported by the Azure AD B2C SAML2 implementation or whether there is a way that the Authentication request that is sent to the Identity Provider can be customized.</p>
  <p>To illustrate, we would like to be able to add this XML snippet to the appropriate location in the SAML2 Authentication request (I included the root element to show the required location):</p>
  <pre><code>&lt;samlp:AuthnRequest ...&gt;
      ...
      &lt;samlp:Scoping ProxyCount=&quot;1&quot;&gt;
          &lt;samlp:IDPList&gt;
              &lt;samlp:IDPEntry ProviderID=&quot;{providerID}&quot;
                              Name=&quot;{name}&quot;
                              /&gt;
          &lt;/samlp:IDPList&gt;
      &lt;/samlp:Scoping&gt;
  &lt;/samlp:AuthnRequest&gt;
  </code></pre>