我正在 Angular 中实现 Azure Active Directory B2C 身份验证。我正在使用 msal 拦截器连接 Azure AD B2C。身份验证请求失败并显示错误
Access to XMLHttpRequest at 'https://login.microsoftonline.com/...' from origin 'http://localhost/...' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我根据这篇文章配置了一切:https://medium.com/@sambowenhughes/configuring-your-angular-6-application-to-use-microsoft-b2c-authentication-99a9ff1403b3
最佳答案
那篇文章大约两年了,this.clientApplication.authority = "https://login.microsoftonline.com/tfp/"
看起来不对。它应该类似于 https://${b2cTenantName}.b2clogin.com/${b2cTenantName}.onmicrosoft.com/B2C_1_Sign_In
.
您可以尝试从 https://github.com/Azure-Samples/active-directory-b2c-javascript-angular-spa 配置 Angular 示例应用程序吗?并以此为起点?
关于Angular Azure Active Directory B2C 身份验证 - CORS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60374965/