从“注册并登录v2政策"中获取电子邮件地址? [英] Obtain email address from Sign up and sign in v2 Policy?

查看:49
本文介绍了从“注册并登录v2政策"中获取电子邮件地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Azure AD配置为身份提供程序.我想知道是否可以让Azure AD传递用户的电子邮件地址,并将其作为用户登录时获得的令牌中的声明传递.否则,如何实现这一目标,我是新手B2C.

I have Azure AD configured as an identity provider. I wanted to know if it is possible to have Azure AD pass along the email address of the user and pass that along as a claim in the token we obtain when users log in. If not, how can I achieve this, I am new to B2C.

推荐答案

您可以使用Azure AD

You can use Azure AD Custom claims to issue the "email" claim in the Azure AD Token that is returned to AAD B2C. This claim is only populated if the user has an Exchange Online inbox.

如果您在Azure AD B2C中使用自定义策略,则可以使用以下方法将声明输出到Claimbag:

If you are using custom policies in Azure AD B2C, you can output the claim into the claimbag using:

<OutputClaim ClaimTypeReferenceId="aadEmail" PartnerClaimType="email" />

其中ClaimTypeReferenceId是AAD B2C将存储的Claimbag声明,PartnerClaimType是您要解析的AAD令牌中的声明名称.

Where the ClaimTypeReferenceId is the claimbag claim that AAD B2C will store, and the PartnerClaimType is the name of the claim in the AAD Token you want to parse.

如果用户没有EXO邮箱,则可以依赖来自Azure AD的用户UserPrincipalName.那就是所谓的 unique_name .因此,您可以在

If the users do not have an EXO mailbox, then you could rely on the users UserPrincipalName coming back from Azure AD. That is in the claim called unique_name. So you could map that in the AAD technical profile by adding the following:

<OutputClaim ClaimTypeReferenceId="upn" PartnerClaimType="unique_name" />

如果您使用的是AAD B2C用户流程,请按照文档

If you are using AAD B2C User Flows, map it as per the doc step 11:

  • 电子邮件:unique_name
  • 电子邮件:电子邮件(如果用户具有EXO收件箱).

这篇关于从“注册并登录v2政策"中获取电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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