1
votes

I'm using the following Microsoft sample for Azure B2C on NodeJS and am receiving the following error:

ERROR: AzureAD: Metadata Parser/59044 on DESKTOP1: cannot get AAD Federation metadata from endpoint you specified
INFO: AzureAD: OIDC Passport Strategy/59044 on DESKTOP1: authentication failed due to: Cannot get AAD Federation metadata

I assume this is referring to the config.js/exports/creds/IdentityMetadata, however I am able to access both of the following B2C URLs directly.

Question

  1. How can I debug the Passport's library failure to access FederationMetadata? (fiddler didn't show any network IO)
  2. Is it stored or cached somewhere?
  3. When and how is it used (for troubleshooting)?
1
Hi @CMEdge. Can you please confirm what you are setting as identityMetadata and isB2C?Chris Padgett
@ChrisPadgett Hi, the isB2C setting is true and the metadata is https://login.microsoftonline.com/gyb2cnonprod.onmicrosoft.com/v2.0/.well-known/openid-configuration , only minor modifications (npm update) from the pull at https://github.com/AzureADQuickStarts/B2C-WebApp-OpenIDConnect-NodeJS.gitCMEdge
The following URL in Passport doesn't work in NodeJS either https://gyb2cnonprod.b2clogin.com/tfp/f8d69b61-eb5a-406a-8a31-654001011012/B2C_1_PassportFlow/v2.0/.well-known/openid-configuration/ @ChrisPadgettCMEdge

1 Answers

0
votes
  1. You should see at leas one initial request, after that metadata is cache in memory.
  2. Node may not have connection to internet. Ensure both node and the browser where you could successfuly connect share and are allowed the same internet access configuration (direct, proxied, etc).

You can debug what url is been set here: https://github.com/AzureAD/passport-azure-ad/blob/fcf9b755a1bbe7a70c7340e2fdd36e8813aa8546/lib/bearerstrategy.js#L582

The error is thrown here: https://github.com/AzureAD/passport-azure-ad/blob/fcf9b755a1bbe7a70c7340e2fdd36e8813aa8546/lib/metadata.js#L185