【发布时间】:2009-08-10 08:58:31
【问题描述】:
我在服务器 A 上的客户端调用 B 上的服务,该服务调用 C 上的服务。
为了让 B->C 的电话正常工作,我必须这样做:
channel.Credentials.Windows.ClientCredential =
new System.Net.NetworkCredential("WndowsUserName", "WindowsPassWord");
IService1 service = channel.CreateChannel();
等等……
用户名和密码是从 A->B 使用的 Windows 凭据 我当然不想硬编码,那我怎么能不硬编码呢?
我试过了,没有运气:
WindowsIdentity callerWindowsIdentity =
ServiceSecurityContext.Current.WindowsIdentity;
using (callerWindowsIdentity.Impersonate())
【问题讨论】: