在上传修改后的trust_framework_extension文件时,我创建了一个新的claimtype并添加了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'中具有无效的子元素'Predicates'。预期可能元素的列表:命名空间'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>
我在设置自定义策略时遇到了这个问题。我认为这与这些孩子在BuildingBlocks
中出现的顺序有关。我按照这里列出的顺序:https://docs.microsoft.com/en-us/azure/active-directory-b2c/buildingblocks。
上传后,我按以下顺序为我工作:
<BuildingBlocks>
<ClaimsSchema>...</ClaimsSchema>
<Predicates>...</Predicates>
<InputValidations>...</InputValidations>
<ContentDefinitions>...</ContentDefinitions>
</BuildingBlocks>