自断言技术配置文件中默认值应配置在InputClaims还是OutputClaims?
自断言技术配置文件默认值配置位置解答
嘿,这个问题我门儿清!答案很明确:要给自断言技术配置文件(Self Asserted Technical Profile)设置默认值,你得在<InputClaims>节点里配置。
为什么是InputClaims而不是OutputClaims?
<InputClaims>的核心作用就是为自断言页面提供初始输入值,当用户打开表单时,这些默认值会直接预填到对应的字段中,方便用户操作。<OutputClaims>则是用来定义这个技术配置文件最终要输出的声明内容,它负责的是收集或处理完成后的结果输出,不承担设置初始默认值的职责。
完整配置代码示例
结合你给出的片段,补全后的配置应该是这样的:
<TechnicalProfile Id="MySelfAssertTp"> <DisplayName>Blah</DisplayName> <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> <Metadata> <!-- 你的元数据配置内容 --> </Metadata> <!-- 在这里配置默认值 --> <InputClaims> <InputClaim ClaimTypeReferenceId="domain_hint" DefaultValue="contoso.com" /> <!-- 其他需要设置默认值的声明都可以放在这个节点下 --> </InputClaims> <OutputClaims> <!-- 这里定义该技术配置文件最终要输出的声明 --> <OutputClaim ClaimTypeReferenceId="domain_hint" /> </OutputClaims> </TechnicalProfile>
这样配置后,用户访问这个自断言页面时,domain_hint字段就会自动填充contoso.com作为默认值,用户可以选择修改这个值或者直接提交表单。
内容的提问来源于stack exchange,提问作者spottedmahn
相关产品推荐
相关产品推荐

