WCF TCP 传输安全和 WIF
我的公司使用 WIF(Windows Identity Foundation)来保护我们的服务。目前我们仅通过 HTTPS 使用 WIF。然而,我们需要保护 TCP 端点,但我遇到了一些麻烦。
我遇到以下异常:
The '{binding name}'.'http://tempuri.org/' binding for the '{IService}'.
'http://tempuri.org/' contract is configured with an authentication mode that requires
transport level integrity and confidentiality. However the transport cannot provide
integrity and confidentiality.
为了将 WIF 纳入图片中,我们必须在服务主机内执行此操作:
var istp = new IssuedSecurityTokenParameters(_TokenType, _IssuerAddress, _IssuerBinding) // issuer address/binding do not matter for this, but must provide something
{
RequireDerivedKeys = false,
KeyType = System.IdentityModel.Tokens.SecurityKeyType.BearerKey
};
TransportSecurity = new TransportSecurityBindingElement();
TransportSecurity.EndpointSupportingTokenParameters.Signed.Add(istp);
TransportSecurity.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12;
我无法取出这些代码行,但我不知道我缺少什么配置来实现此目的与 TCP 一起工作。任何帮助都会很棒。
My company uses WIF (Windows Identity Foundation) to secure our sevices. Currently we only use WIF over HTTPS. However, we need to secure a TCP endpoint and I'm running into some trouble.
I'm getting following exception:
The '{binding name}'.'http://tempuri.org/' binding for the '{IService}'.
'http://tempuri.org/' contract is configured with an authentication mode that requires
transport level integrity and confidentiality. However the transport cannot provide
integrity and confidentiality.
In order to get WIF into the picture we have to do this inside the service host:
var istp = new IssuedSecurityTokenParameters(_TokenType, _IssuerAddress, _IssuerBinding) // issuer address/binding do not matter for this, but must provide something
{
RequireDerivedKeys = false,
KeyType = System.IdentityModel.Tokens.SecurityKeyType.BearerKey
};
TransportSecurity = new TransportSecurityBindingElement();
TransportSecurity.EndpointSupportingTokenParameters.Signed.Add(istp);
TransportSecurity.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12;
I can't take those lines of code out but I don't know what configuration I'm missing to make this work with TCP. Any help at all would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论