具有自定义声明和策略的Azure B2C外部提供程序

时间:2020-06-25 17:17:02

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

我有一个Azure B2C租户,其中包含一些身份提供程序(Facebook,LinkedIn等),以及一个自定义声明,用户可以选择性别。

在与其中之一进行唱歌时,我能够获得令牌中的性别声明,但是当用户登录时,这种情况不会发生。我想知道在哪里映射/包含此正确位置自从我一直在使用基本的自定义政策以来,就获得了自定义声明:SocialAndLocalAccount

关于从哪里获得的任何线索?我在 SelfAsserted-Social的技术资料中有我的自定义声明,但登录期间没有运气。

1 个答案:

答案 0 :(得分:1)

SelfAsserted-Social技术配置文件仅在用户首次连接其社交帐户时执行。

您会看到from the comments in the user journey

Show self-asserted page only if the directory does not have the user account already (i.e. we do not have an objectId).

如果您想重复使用该声明,则需要坚持该声明as per comment here

If a claim is to be persisted in the directory after having been collected from the user, it needs to be added as a PersistedClaim in the ValidationTechnicalProfile referenced below

然后,您需要在AAD-UserRead...技术资料中从广告中阅读它

并将其输出到中继方的输出声明中。

请遵循本指南https://docs.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-configure-user-input#add-a-claim-to-the-user-interface的社交资料,其中示例中的city是您的gender声明。