Tag: wif nettcpbinding

Catch-22防止通过WIF保证stream式TCP WCF服务的安全 毁了我的圣诞节,心理健康

我需要使用WIF保护stream式WCF net.tcp服务端点 。 它应该authentication来自我们的令牌服务器的来电。 该服务是stream式传输,因为它旨在传输大量数据。 这似乎是不可能的。 如果我无法绕过捕捉,我的圣诞节将被毁坏,我会喝水自己死在一个天沟,而快乐的购物者走过我慢慢冷却的身体。 大家好,你们。 为什么这是不可能的? 这是Catch-22。 在客户端上,我需要使用从令牌服务器获得的GenericXmlSecurityToken创build一个通道。 没问题。 // people around here hate the Framework Design Guidelines. var token = Authentication.Current._Token; var service = base.ChannelFactory.CreateChannelWithIssuedToken(token); return service.Derp(); 我说“没问题”吗? Problemo。 实际上, NullReferenceException样式问题。 “兄弟,”我问框架,“你甚至无效检查? 该框架是沉默的,所以我拆解,发现 ((IChannel)(object)tChannel). GetProperty<ChannelParameterCollection>(). Add(federatedClientCredentialsParameter); 是exception的来源,并且GetProperty调用返回null 。 那么,WTF? 原来,如果我打开消息安全性并将客户端凭证types设置为IssuedToken则此属性现在存在于ClientFactory (protip:在IChannel中没有“SetProperty”等价物,这个混蛋)。 <binding name="OMGWTFLOL22" transferMode="Streamed" > <security mode="Message"> <message clientCredentialType="IssuedToken"/> </security> </binding> […]