【问题标题】:AAD-FindLocalAccountWithSocialEmail produces No suitable claims providers were foundAAD-FindLocalAccountWithSocialEmail 产生 No suitable claims providers were found
【发布时间】:2022-12-19 15:47:08
【问题描述】:

我正在尝试将社交提供商登录名自动链接到现有的本地帐户。 我正在使用 auto-linking sample,但这样做已经将示例 Facebook ClaimsProviders/etc 替换为适用于 Google 的示例。使用我的 B2C_1A_ACCOUNTLINK_SUSI 版本,我可以成功创建并登录本地帐户。我还可以使用 Google 成功添加用户(如果我事先删除了用户 - 没有链接)。所以,我知道这些都是单独工作的。

然而,当我创建本地帐户并尝试使用 Google 作为 idp 登录并链接该帐户时,我收到一条错误消息,提示找不到合适的索赔提供者。

有没有人用谷歌试过这个自动链接示例并看到我可能需要对输入/输出声明或其他进行的任何调整?在几个周末的时间里,我做了几个,试图让它发挥作用。 AppInsights 显示它发生在 AAD-FindLocalAccountWithSocialEmail (AzureActiveDirectoryProvider) 中,异常是:找不到合适的声明提供者。

任何建议表示赞赏。如果这有助于诊断,我可以发布我的 Google ClaimsProvider 块。

【问题讨论】:

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


    【解决方案1】:

    可能是因为未使用发行者集合启用 IdP。

    在您所有的 Google IdP 技术资料中,请确保:

      <OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="google.com" AlwaysUseDefaultValue="true" />
    

    Google-OAUTH-Link技术资料中,确保有这个:

    <Metadata>
      <Item Key="ClaimTypeOnWhichToEnable">currentIssuers</Item>
      <Item Key="ClaimValueOnWhichToEnable">google.com</Item>
    </Metadata> 
    <!--snip-->
    <OutputClaimsTransformations>
      <OutputClaimsTransformation ReferenceId="CreateUserIdentityToLink" />
      <OutputClaimsTransformation ReferenceId="AppendUserIdentityToLink" />
    </OutputClaimsTransformations>
    <EnabledForUserJourneys>OnItemExistenceInStringCollectionClaim</EnabledForUserJourneys>
    

    HandleLinkLocalToSocial 子旅程中,确保在链接步骤中添加 Google IdP:

            <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.idpselections">
    <!--snip preconditions-->
              <ClaimsProviderSelections DisplayOption="ShowSingleProvider">
                <ClaimsProviderSelection TargetClaimsExchangeId="LinkGoogleExchange1"/>
              </ClaimsProviderSelections>
            </OrchestrationStep>
    
            <OrchestrationStep Order="2" Type="ClaimsExchange">
    <!--snip preconditions-->
              <ClaimsExchanges>
                <ClaimsExchange Id="LinkGoogleExchange1" TechnicalProfileReferenceId="Google-OAUTH-Link"/>
              </ClaimsExchanges>
            </OrchestrationStep>
    
            <OrchestrationStep Order="3" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
    <!--snip preconditions-->
              <ClaimsProviderSelections DisplayOption="ShowSingleProvider">
                <ClaimsProviderSelection TargetClaimsExchangeId="LinkGoogleExchange2"/>
            </OrchestrationStep>
    
            <OrchestrationStep Order="4" Type="ClaimsExchange">
    <!--snip preconditions-->
              <ClaimsExchanges>
                <ClaimsExchange Id="LinkGoogleExchange2" TechnicalProfileReferenceId="Google-OAUTH-Link"/>
              </ClaimsExchanges>
            </OrchestrationStep>  
    
    

    【讨论】:

    • 谢谢您的帮助。上面我唯一缺少的是我的 Google-OAuth-Link 中 identityProvider 的 OutputClaim。我更新并测试了,但仍然遇到同样的错误。
    • 如果您可以将您的政策发布到 github 并链接它们,那么我们可以看看。
    • 需要注意的一件事是,我之前遇到过这个错误,不确定它是需要 AAD client_id 还是 Google client_id。我都试过了,但不确定为什么无论如何都需要它,而样本中没有它。错误:在策略“B2C_1A_AccountLink_SUSI”中 ID 为“AAD-FindLocalAccountWithSocialEmail”的 TechnicalProfile 中找不到键为“ClientId”的必需元数据项
    • 那是因为您没有为扩展属性启用策略。使用工具aka.ms/iefsetup 完全设置环境。否则请参阅article
    【解决方案2】:

    使用auto-linking sample code 时出现同样的错误。检查技术配置文件 AAD-FindLocalAccountWithSocialEmail 的输出声明部分。声明 currentUserIdentities 是从那里的目录中读取的,并且是此 TP 的 ExtractCurrentIssuers 输出声明转换的输入(它填充 currentIssuers 声明并将其放入声明包中)。 问题似乎是错误的 PartnerClaimType 值。

    尝试

    &lt;OutputClaim ClaimTypeReferenceId="currentUserIdentities" PartnerClaimType="identities"/&gt;

    代替

    &lt;OutputClaim ClaimTypeReferenceId="currentUserIdentities" PartnerClaimType="userIdentities"/&gt;

    如果 PartnerClaimType 错误,则结果为空,并且空的 currentIssuers 字符串集合会导致您描述的错误(在 Google-OAUTH-Link TP 中)。 如果 App-Insights 可以显示索赔集合的价值,那就太好了。

    【讨论】:

      【解决方案3】:

      我有与自动帐户链接示例相关的相同问题,对于我的情况,我只能通过在 AAD-FindLocalAccountWithSocialEmail 技术配置文件中添加输出声明来修复它。希望可以帮助别人

      <OutputClaims>
        <!-- sinp-->
        <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />
      </OutputClaims>

      【讨论】:

        猜你喜欢
        • 2013-10-29
        • 2022-12-21
        • 1970-01-01
        • 2020-09-03
        • 2022-12-24
        • 1970-01-01
        • 2012-04-02
        • 2012-01-21
        • 1970-01-01
        相关资源
        最近更新 更多