title: Azure Active Directory B2C with Passport.js error "Cannot get aad federation metadata" error
body: <p>I'm trying to implement customer-facing authentication for my Node.js web app using Passport.js and Azure Active Directory B2C with the OpenID Connect strategy. </p>
  
  <p>I have followed the README instructions from the official GitHub page and studied the source code of the official sample apps, but they seem to be incomplete and/or out of date, as agreed by various threads online.</p>
  
  <p>After piecing together various tips from around the web, I have crossed many bridges, but reached an impasse with the following error:</p>
  
  <p><code>cannot get AAD Federation metadata from endpoint you specified</code>.</p>
  
  <p>There is a ton of configuration required for AAD authentication, so I will note some important values:</p>
  
  <ul>
  <li><code>policyName</code>: This is <code>b2c_1_signin</code>, just like I have configured in the Azure portal.</li>
  <li><code>identityMetadata</code>: I'm using a tenant-specific, v2.0 endpoint. I added <code>?p=b2c_1_signin</code> to inject the policy name.</li>
  <li><code>responseType</code>: <code>id_token</code></li>
  <li><code>redirectUrl</code>: This is my localhost and port, as configured in Azure. <code>allowHttpForRedirectUrl</code> is set to <code>true</code>. (This works for non-prod environments.)</li>
  <li><code>isB2C</code>: <code>true</code></li>
  </ul>