Azure B2C自定义策略令牌缺少信息

时间:2020-08-05 20:02:28

标签: azure-ad-b2c

我们有一个自定义策略设置,可在用户签名时验证电话号码。用户完成社交登录后,将在单独的屏幕上验证电话号码。问题是生成的令牌不包含电话号码。如果用户注销并重新登录,则电话号码将包含在令牌中。如何获取初始令牌中包含的电话号码,以便用户无需注销?

1 个答案:

答案 0 :(得分:0)

您可以将 strongAuthenticationPhoneNumber 声明添加为ID令牌中的传出声明:

<RelyingParty>
  <DefaultUserJourney ReferenceId="SignUpOrSignIn" />
  <TechnicalProfile Id="PolicyProfile">
    <DisplayName>PolicyProfile</DisplayName>
    <Protocol Name="OpenIdConnect" />
    <OutputClaims>
      ...
      <OutputClaim ClaimTypeReferenceId="strongAuthenticationPhoneNumber" PartnerClaimType="phone_number" />
    </OutputClaims>
    <SubjectNamingInfo ClaimType="sub" />
  </TechnicalProfile>
</RelyingParty>