问题
Following this tutorial by Microsoft, the JavaScript application is not able to access the API protected by Azure AD B2C. The application is able to login/authenticate, but when clicking the Call Web API
button, the following message is output onto the page:
Web APi returned:
"AuthenticationFailed: IDX10803: Unable to obtain configuration from: 'https://b2c-tenant-name.microsoftonline.com/tfp/b2c-tenant-name.onmicrosoft.com/B2C_1_signupsignin/v2.0/.well-known/openid-configuration'."
How can this be repaired? What change is required to allow the JavaScript SPA to call the protected web API?
回答1:
Well that URL looks a bit odd. It should be something like:
https://b2c-tenant-name.b2clogin.com/b2c-tenant-name.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_signupsignin
I got this from the Run user flow feature in the Azure portal.
You can't use microsoftonline.com URLs any more. They were deprecated. The host is now b2clogin.com.
来源:https://stackoverflow.com/questions/60682584/unable-to-obtain-configuration-from-azure-ad-b2c