命名空间中的元素“ BuildingBlocks”在命名空间中具有无效的子元素“谓词”

时间:2019-03-28 22:03:09

标签: azure-ad-b2c

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

“名称空间'http://schemas.microsoft.com/online/cpim/schemas/2013/06'中的元素'BuildingBlocks'在名称空间中具有无效的子元素'谓词...”

文档显示“ 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 col 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>

1 个答案:

答案 0 :(得分:0)

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

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

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