【问题标题】:Azure B2c custom attributes in custom policies do not come in the token自定义策略中的 Azure B2c 自定义属性不在令牌中
【发布时间】:2020-12-28 13:32:26
【问题描述】:

我在 Azure B2c 中创建了自定义策略并使用了自定义属性。

但是,自定义属性仅在用户创建帐户时输入令牌。当他再次登录时,自定义属性没有进入令牌。

下面是我的 RelyingParty。

<RelyingParty>
    <DefaultUserJourney ReferenceId="SignUpOrSignIn" />
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="displayName" />
        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surname" />
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="identityProvider" />
        <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
        <OutputClaim ClaimTypeReferenceId="extension_time" DefaultValue="" />
      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
  </RelyingParty>

【问题讨论】:

  • 您好 Victor,您能否分享更多您的代码,以便我们更好地了解应该如何使用 extension_time?

标签: azure azure-ad-b2c azure-ad-b2c-custom-policy


【解决方案1】:

将 extension_time 作为输出声明添加到 AAD-UserReadUsingObjectId 技术配置文件中。

【讨论】:

  • 您说得对,我删除了此技术配置文件,因为发生了错误,并且我知道它是用于社交帐户登录的。但是现在我按照您的提示输入了正确的元数据,并且效果很好,谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-16
  • 1970-01-01
  • 2019-04-13
  • 2018-01-24
相关资源
最近更新 更多