我们如何将一个的WindowsIdentity
到的NetworkCredential
?我测试我的WCF服务,以验证匿名来电者将被阻止。要做到这一点,我想做的事情是这样的:
How do we convert a WindowsIdentity
to a NetworkCredential
? I am testing my WCF service to verify that anonymous callers are blocked. To do this I want to do something like:
myProxy.ClientCredentials.Windows.ClientCredential = foo(WindowsIdentity.GetAnonymous());
其中,富
是一个能转换的WindowsIdentity
到的NetworkCredential
回答我的问题:
这是不可能的转换的WindowsIdentity
到的NetworkCredential
。为了测试是否匿名来电者被阻挡,冒充当前线程与href="http://www.nullsession.net/2009/what-is-a-null-session/" rel="nofollow">空会话令牌的