如何的WindowsIdentity转换为的NetworkCredential?转换为、WindowsIdentity、NetworkCredential

2023-09-04 03:55:23 作者:丶残叶兮,〃

我们如何将一个的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">空会话令牌的

 
精彩推荐
图片推荐