【发布时间】:2011-07-25 15:14:56
【问题描述】:
为简单起见,我实现了以下类:
public class CustomUserNamePasswordValidatorSecurityTokenHandler : UserNameSecurityTokenHandler {}
我已经启用了它的配置(并启用了正确的 configSection):
<microsoft.identityModel>
<service>
<securityTokenHandlers>
<clear />
<add type="CustomUserNamePasswordValidatorSecurityTokenHandler" />
</securityTokenHandlers>
</service>
</microsoft.identityModel>
并针对我的 STS 收益执行实际的 RP 调用(在服务跟踪查看器中):
令牌序列化程序无法序列化“Microsoft.IdentityModel.Tokens.SessionSecurityToken”。如果这是自定义类型,您必须提供自定义序列化程序。
如果我注释掉配置(因此没有应用令牌处理程序),一切正常。如何提供此自定义序列化程序?
注意:this thread 中有几个关于该问题的参考,但我没有看到解决方案。
【问题讨论】: