【问题标题】:The element 'BuildingBlocks' in namespace has invalid child element 'Predicates' in namespace命名空间中的元素“BuildingBlocks”在命名空间中具有无效的子元素“谓词”
【发布时间】:2019-03-28 22:03:09
【问题描述】:

在上传修改后的 trust_framework_extension 文件时,我创建了一个新的声明类型并添加了 Predicates 和 PredicateValidations 元素,但是当我上传文件时出现错误

“命名空间‘http://schemas.microsoft.com/online/cpim/schemas/2013/06’中的元素‘BuildingBlocks’在命名空间中有无效的子元素‘Predicates’...”

文档显示“buildingBlocks”应该包含“Predicates”和“PredicateValidations”,但它会引发错误。

“InputValidations”也不再在构建块中,因为我也遇到了错误。 关注在线文档 :: https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-password-complexity-custom

错误:: 验证失败:在租户“abc.onmicrosoft.com”的策略“B2C_1A_B_TRUSTFRAMEWORKEXTENSIONS”中发现 1 个验证错误。在租户“abc.onmicrosoft.com”的策略“B2C_1A_B_TRUSTFRAMEWORKEXTENSIONS”的第 78 列第 6 行发现架构验证错误:命名空间“http://schemas.microsoft.com/online/cpim/schemas/2013/06”中的元素“BuildingBlocks”在命名空间“http://schemas.microsoft.com/online/cpim/schemas/2013/06”中具有无效的子元素“谓词”。预期的可能元素列表:命名空间“http://schemas.microsoft.com/online/cpim/schema”中的“ClientDefinitions、ContentDefinitions、Localization”

     <BuildingBlocks>
<ClaimsSchema>
  <ClaimType Id="newPassword">
      <InputValidationReference Id="PasswordValidation" />
    </ClaimType>
    <ClaimType Id="reenterPassword">
      <InputValidationReference Id="PasswordValidation" />
  </ClaimType>
</ClaimsSchema>
<Predicates>
          <Predicate Id="Length" Method="IsLengthRange" HelpText="The password must be between 3 and 5 characters.">
              <Parameters>
                  <Parameter Id="Minimum">3</Parameter>
                  <Parameter Id="Maximum">5</Parameter>
              </Parameters>
            </Predicate>


            <Predicate Id="Number" Method="IncludesCharacters">
                <UserHelpText>a digit</UserHelpText>
                    <Parameters>
                      <Parameter Id="CharacterSet">0-9</Parameter>
                    </Parameters>
            </Predicate>
      </Predicates>
<PredicateValidations>
    <PredicateValidation Id="PasswordValidation">
        <PredicateReferences Id="LengthGroup" MatchAtLeast="1">
          <PredicateReference Id="Length" />
        </PredicateReferences>
        <PredicateReferences Id="3of4" MatchAtLeast="1" HelpText="only Numbers allowed">

          <PredicateReference Id="Number" />
        </PredicateReferences>
    </PredicateValidation>
</PredicateValidations>

【问题讨论】:

  • 嗨@kbaig。你能在上面的问题中加入&lt;BuildingBlocks /&gt;sn-p 吗?
  • 这是因为 XML 验证失败。您能否根据随入门包发布的 XSD 验证您的文件?这将允许您隔离客户端上的问题并解决它。请注意,XML 是特定于顺序的,因此如果您在 BuildingBlocks 下添加元素的顺序与 XSD 中指定的顺序不同,则会失败并出现此错误。
  • 这是我在目录中找到的唯一 xsd 文件“TrustFrameworkPolicy_0.3.0.0.xsd”,它没有名为 Predicates、predicate 或 PredicateValidations 的元素。在线文档显示这些元素应该在此链接之后的 buildingblocks 元素中github.com/MicrosoftDocs/azure-docs/blob/master/articles/…

标签: azure-ad-b2c


【解决方案1】:

我在设置自定义策略时也遇到了这个问题。我认为这与这些孩子出现在BuildingBlocks 中的顺序有关。我按照这里列出的顺序:https://docs.microsoft.com/en-us/azure/active-directory-b2c/buildingblocks

上传后按以下顺序为我工作:

<BuildingBlocks>
    <ClaimsSchema>...</ClaimsSchema>
    <Predicates>...</Predicates>
    <InputValidations>...</InputValidations>
    <ContentDefinitions>...</ContentDefinitions>
</BuildingBlocks>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-18
  • 1970-01-01
  • 2012-04-04
  • 1970-01-01
相关资源
最近更新 更多