Azure AD B2C 缺少使用本地帐户和用户 ID 登录的电子邮件声明

时间:2021-05-31 23:23:33

标签: azure-ad-b2c

我正在使用标准登录用户策略设置新的 Azure AD B2C 目录。我计划让管理员创建用户帐户,因此不需要注册策略。我的问题是我想返回为用户帐户创建的电子邮件地址,但是当我测试用户流时,电子邮件地址是唯一缺少的声明。是否有原因和解决方法?

测试用户帐户并填充电子邮件地址。 enter image description here

IDP 设置 enter image description here

enter image description here

用户流应用声明设置 enter image description here

测试用户流时声明返回 enter image description here

1 个答案:

答案 0 :(得分:2)

B2C 内置用户流主要收集本地账户的 2 个位置的电子邮件地址。

一个是 otherMails (Microsoft Grpah) / Alternate email(Azure Portal)。

enter image description here

另一个是 signInType 为 emailAddress (Microsoft Graph) 的身份。

enter image description here

因此,如果您的本地帐户使用“用户 ID”选项进行注册,则没有 signInType 为 emailAddress 的身份。如果 otherMails (Microsoft Grpah) / Alternate email 也未设置,则令牌中不会有任何电子邮件声明。

请更新我提到的属性(otherMails / Alternate email 或使用电子邮件地址注册/添加一个 signInType 为 emailAddress 的身份,使用 Microsoft Graph)以使其包含在令牌。