Azure AD B2C - 令牌刷新后原始身份验证源丢失

问题描述 投票:0回答:1

我目前正在制定 Azure AD B2C 自定义策略,该策略使用户能够拥有多个身份(Google、Microsoft、Apple 和 Entra ID)。 Entra ID ClaimsProvider 设置从

entraTenantId
声明派生的
iss
声明,然后通过 RelyingParty 发送到应用程序。

但是,我注意到应用程序使用

grant_type: refresh_token
获取新令牌后,UserJourney
RedeemRefreshToken
不会返回
entraTenantId
identityProvider
,这对于我的应用程序至关重要功能。

有人可以建议如何确保

entraTenantId
identityProvider
包含在刷新的令牌中,或者建议解决此问题的替代方法吗?

我尝试通过将

entraTenantId
输出声明添加到
RefreshTokenReadAndSetup
ClaimsProvider 来解决该问题,但不幸的是,这种调整没有产生预期的结果。

我的目标是检索并输出用户最初用于从

RedeemRefreshToken
旅程登录的提供商的名称。

我追求的解决方案基于Azure AD B2C提供的SocialAndLocalAccounts示例。

谢谢!

azure-ad-b2c azure-ad-b2c-custom-policy microsoft-entra-id
1个回答
0
投票

如果其他人也遇到同样的问题,我最终通过将声明添加到

RefreshTokenReadAndSetup
TechnicalProfile 来解决问题。文档中没有明确提及,但 AAD B2C 在颁发新令牌时能够使用原始身份验证上下文。

  <ClaimsProvider>
    <DisplayName>Refresh token journey</DisplayName>
    <TechnicalProfiles>
      <TechnicalProfile Id="RefreshTokenReadAndSetup">
        <DisplayName>Trustframework Policy Engine Refresh Token Setup Technical Profile</DisplayName>
        <Protocol Name="None" />
        <OutputClaims>
          <OutputClaim ClaimTypeReferenceId="objectId" />
          <OutputClaim ClaimTypeReferenceId="refreshTokenIssuedOnDateTime" />
          <OutputClaim ClaimTypeReferenceId="entraTenantId" PartnerClaimType="entra_id_tenant" />
          <OutputClaim ClaimTypeReferenceId="identityProvider" />

        </OutputClaims>
      </TechnicalProfile>
© www.soinside.com 2019 - 2024. All rights reserved.