如何通过 Azure AD B2C 使用身份验证功能在 Azure Web App 上添加身份验证?

时间:2021-04-09 10:30:00

标签: azure azure-active-directory azure-ad-b2c azure-webapps

我想使用 Azure AD B2C 向在 Azure Web 应用程序上运行的 Web 应用程序添加身份验证。

为此,我遵循了以下步骤:

  1. 在 Azure AD B2C 上创建租户
  2. 添加应用注册和客户端密钥
  3. 添加用户流程
  4. 从 Azure Web Apps 上的“身份验证”(在左侧面板上),我选择 Microsoft 作为身份提供者,并根据前面步骤中获得的值提供配置。

但是当我访问 Azure Web Apps url 时,我没有被重定向到登录页面,而是收到以下消息。

{"code":401,"message":"An error of type 'unauthorized_client' occurred during the login process: 'AADB2C90057: The provided application is not configured to allow the 'OAuth' Implicit flow.\r\nCorrelation ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\nTimestamp: 2021-04-09 10:06:00Z\r\n'"}

此外,在标识提供程序的编辑页面中,它显示 Application with ID xxxxxxxxxxxxxxxx not found in the current tenant. Tenant ID: yyyyyyyyyyyyyyyyy.

这显然意味着我在 Azure B2C 租户上注册的应用程序与 Azure Web Apps 链接的租户不在同一个租户上。

我的问题是“如何通过 Azure AD B2C 使用其“身份验证”功能在 Azure Web 应用程序上添加身份验证?”。 “身份验证”功能的 Microsoft 身份提供程序是否仅支持与 Azure Web Apps 位于同一租户上的客户端?

1 个答案:

答案 0 :(得分:2)

<块引用>

如何使用其“身份验证”在 Azure Web App 上添加身份验证 通过 Azure AD B2C 提供功能?

根据您的错误,应该是您的应用程序未启用隐式流引起的。因此,您需要在 Azure B2C 中启用它。

  1. 转到 Azure B2C 门户>应用注册>您的应用>身份验证。

enter image description here

2.转到 Azure B2C 门户>应用程序(旧版)>您的应用。

enter image description here

<块引用>

是否仅提供“身份验证”功能的 Microsoft 身份提供者 支持与 Azure Web Apps 位于同一租户的客户端?

是的。

相关问题