首页 > 解决方案 > Azure B2c 错误“无法验证提供的信息。” 使用自定义属性时

问题描述

我正在尝试将自定义属性添加到自定义策略中。但是,它会生成此错误“无法验证所提供的信息”。

我遵循了以下链接的文档,我已经添加了应用程序 id b2c-extensions-app 和对象。

https://docs.microsoft.com/pt-br/azure/active-directory-b2c/custom-policy-custom-attributes

https://docs.microsoft.com/pt-br/azure/active-directory-b2c/configure-user-input?pivots=b2c-custom-policy

错误日志消息“返回的错误是 400/Request_BadRequest:以下扩展属性不可用:extension_f41be ....._tipoUsuario。”

我的 TrustFrameworkExtensions 文件中的部分代码,它在 AD 中写入和检索信息:

<ClaimsProvider>
  <DisplayName>Azure Active Directory</DisplayName>
  <TechnicalProfiles>
    <TechnicalProfile Id="AAD-Common">
      <Metadata>
        <!--Insert b2c-extensions-app application ID here, for example: 11111111-1111-1111-1111-111111111111-->
        <Item Key="5bfd........"></Item>
        <!--Insert b2c-extensions-app application ObjectId here, for example: 22222222-2222-2222-2222-222222222222-->
        <Item Key="18bd6......."></Item>
      </Metadata>
    </TechnicalProfile>
    <TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
      <Metadata>
        <Item Key="client_id">f41be......</Item>
        <!--Insert b2c-extensions-app application ID here, for example: 11111111-1111-1111-1111-111111111111-->
       
      </Metadata>
      <PersistedClaims>
        <PersistedClaim ClaimTypeReferenceId="extension_tipoUsuario"/>
      </PersistedClaims>
    </TechnicalProfile>
    <!-- Write data during edit profile flow. -->
    <TechnicalProfile Id="AAD-UserWriteProfileUsingObjectId">
     
      <PersistedClaims>
        <PersistedClaim ClaimTypeReferenceId="extension_tipoUsuario"/>
      </PersistedClaims>
    </TechnicalProfile>
    <!-- Read data after user authenticates with a local account. -->
    <TechnicalProfile Id="AAD-UserReadUsingEmailAddress">
      
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="extension_tipoUsuario" />
      </OutputClaims>
    </TechnicalProfile>
    <!-- Read data after user authenticates with a federated account. -->
    <TechnicalProfile Id="AAD-UserReadUsingObjectId">
     
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="extension_tipoUsuario" />
      </OutputClaims>
    </TechnicalProfile>
  </TechnicalProfiles>
</ClaimsProvider>

标签: azureazure-ad-b2cazure-ad-b2c-custom-policy

解决方案


此问题的常见根本原因之一是 B2C 扩展应用程序的客户端 ID 元数据配置错误。

确保遵循此处的教程。


推荐阅读