无法上传策略,元素 'ClaimType' 具有无效的 child 元素,应为:'InputValidationReference, PredicateValidationReference'
Unable to upload policy, The element 'ClaimType' has invalid child element, expected: 'InputValidationReference, PredicateValidationReference'
当我尝试上传以下声明时,它失败了:
<ClaimType Id="my-claim">
<DisplayName>My Claim</DisplayName>
<DataType>string</DataType>
<UserHelpText>some text</UserHelpText>
<UserInputType>TextBox</UserInputType>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9.!#$%&'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="..." />
</Restriction>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="blah" />
<Protocol Name="OpenIdConnect" PartnerClaimType="blah" />
</DefaultPartnerClaimTypes>
</ClaimType>
出现以下错误:
Unable to upload policy. Reason : Validation failed: 1 validation error(s) found in policy "B2C_1A_TRUSTFRAMEWORK_BUILDINGBLOCKS" of tenant "mytenant.onmicrosoft.com".
Schema validation error found at line 172 col 10 in policy "B2C_1A_TRUSTFRAMEWORK_BUILDINGBLOCKS" of tenant "mytenant.onmicrosoft.com": The element 'ClaimType' in namespace 'http://schemas.microsoft.com/online/cpim/schemas/2013/06' has invalid child element 'DefaultPartnerClaimTypes' in namespace 'http://schemas.microsoft.com/online/cpim/schemas/2013/06'.
List of possible elements expected: 'InputValidationReference, PredicateValidationReference' in namespace 'http://schemas.microsoft.com/online/cpim/schemas/2013/06'.
如果我移动<DefaultPartnerClaimTypes>
向上一点,策略就会上传。
<ClaimType Id="my-claim">
<DisplayName>My Claim</DisplayName>
<DataType>string</DataType>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="blah" />
<Protocol Name="OpenIdConnect" PartnerClaimType="blah" />
</DefaultPartnerClaimTypes>
<UserHelpText>some text</UserHelpText>
<UserInputType>TextBox</UserInputType>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9.!#$%&'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="..." />
</Restriction>
</ClaimType>
我觉得 "right" 不是。 <ClaimType>
的 children 的顺序应该无关紧要吧?
XSD file中是否指定了该顺序? (我听说我可以配置 VS Code 来根据 XSD 验证我的 XML,我需要弄清楚该怎么做...)
是的,the "ClaimType" type requires the child elements to be appended in the declared sequence, as defined by the XML schema;否则它不会通过架构验证。
这也适用于此 XML 架构定义的所有其他类型。
当我尝试上传以下声明时,它失败了:
<ClaimType Id="my-claim">
<DisplayName>My Claim</DisplayName>
<DataType>string</DataType>
<UserHelpText>some text</UserHelpText>
<UserInputType>TextBox</UserInputType>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9.!#$%&'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="..." />
</Restriction>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="blah" />
<Protocol Name="OpenIdConnect" PartnerClaimType="blah" />
</DefaultPartnerClaimTypes>
</ClaimType>
出现以下错误:
Unable to upload policy. Reason : Validation failed: 1 validation error(s) found in policy "B2C_1A_TRUSTFRAMEWORK_BUILDINGBLOCKS" of tenant "mytenant.onmicrosoft.com".
Schema validation error found at line 172 col 10 in policy "B2C_1A_TRUSTFRAMEWORK_BUILDINGBLOCKS" of tenant "mytenant.onmicrosoft.com": The element 'ClaimType' in namespace 'http://schemas.microsoft.com/online/cpim/schemas/2013/06' has invalid child element 'DefaultPartnerClaimTypes' in namespace 'http://schemas.microsoft.com/online/cpim/schemas/2013/06'.
List of possible elements expected: 'InputValidationReference, PredicateValidationReference' in namespace 'http://schemas.microsoft.com/online/cpim/schemas/2013/06'.
如果我移动<DefaultPartnerClaimTypes>
向上一点,策略就会上传。
<ClaimType Id="my-claim">
<DisplayName>My Claim</DisplayName>
<DataType>string</DataType>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="blah" />
<Protocol Name="OpenIdConnect" PartnerClaimType="blah" />
</DefaultPartnerClaimTypes>
<UserHelpText>some text</UserHelpText>
<UserInputType>TextBox</UserInputType>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9.!#$%&'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="..." />
</Restriction>
</ClaimType>
我觉得 "right" 不是。 <ClaimType>
的 children 的顺序应该无关紧要吧?
XSD file中是否指定了该顺序? (我听说我可以配置 VS Code 来根据 XSD 验证我的 XML,我需要弄清楚该怎么做...)
是的,the "ClaimType" type requires the child elements to be appended in the declared sequence, as defined by the XML schema;否则它不会通过架构验证。
这也适用于此 XML 架构定义的所有其他类型。