无法从Azure AD B2C获取配置 [英] Unable to obtain configuration from Azure AD B2C

查看:118
本文介绍了无法从Azure AD B2C获取配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遵循本教程由Microsoft提供,JavaScript应用程序无法访问受Azure AD B2C保护的API.该应用程序可以登录/认证,但是当单击Call Web API按钮时,以下消息将输出到页面上:

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返回:
"AuthenticationFailed:IDX10803:无法从以下位置获取配置:' https://b2c-tenant-name.microsoftonline.com/tfp/b2c-tenant-name.onmicrosoft.com/B2C_1_signupsignin/v2.0/.well-已知/openid配置'."

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'."

该如何修复?要使JavaScript SPA调用受保护的Web API,需要进行哪些更改?

How can this be repaired? What change is required to allow the JavaScript SPA to call the protected web API?

推荐答案

该URL看起来有些奇怪. 应该是这样的:

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

我是从Azure门户的运行用户流"功能中获得的.

I got this from the Run user flow feature in the Azure portal.

您不能再使用microsoftonline.com URL. 他们已被弃用. 主机现在是b2clogin.com.

You can't use microsoftonline.com URLs any more. They were deprecated. The host is now b2clogin.com.

这篇关于无法从Azure AD B2C获取配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆