微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在Azure Active Directory B2C自定义策略中通过电子邮件查找现有用户

如何解决在Azure Active Directory B2C自定义策略中通过电子邮件查找现有用户

我正在Azure AD B2C中创建自定义策略,以使受邀用户可以通过另一个Azure AD(甚至ADFS)登录。我的问题是登录时会创建一个新用户(而不是受邀用户)。我发现我一直在尝试使用alternativesecurityid或objectid在我的AAD中找到现有用户,而这两个都不匹配。所以我想我需要通过电子邮件而不是任何ID查找现有用户。这也行不通,因为我可以看到受邀用户的电子邮件位于其他邮件邮件属性中(通过GraphAPI),显然我无法通过这些字段查询B2C。

<TechnicalProfile Id="AAD-ReadUserByEmail">
  <Metadata>
    <Item Key="Operation">Read</Item>
    <Item Key="raiseerrorIfClaimsPrincipalDoesNotExist">false</Item>
  </Metadata>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="emailFromSocialAccount" PartnerClaimType="mail" required="true" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="objectId" />
    <OutputClaim ClaimTypeReferenceId="displayName" />
    <OutputClaim ClaimTypeReferenceId="givenname" />
    <OutputClaim ClaimTypeReferenceId="surname" />
    <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
  </OutputClaims>
  <IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>

只有<InputClaim ClaimTypeReferenceId="emailFromSocialAccount" PartnerClaimType="signInNames.emailAddress" required="true" />通过验证,但是此字段没有任何数据。

如何找到受邀用户

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。