C# 获取wcf上的网络凭据详细信息

C# 获取wcf上的网络凭据详细信息,c#,.net,wcf,C#,.net,Wcf,我有一个基于REST的WCF服务。如果客户端通过NetworkCredential传递登录详细信息,如:- WebClient webClient = new WebClient(); webClient.Credentials = new System.Net.NetworkCredential("slash", "slash"); 那么如何在WCF中获取这些网络凭据详细信息。尝试使用OperationContext OperationContext.Current.Servic

我有一个基于REST的WCF服务。如果客户端通过NetworkCredential传递登录详细信息,如:-

   WebClient webClient = new WebClient();
   webClient.Credentials = new System.Net.NetworkCredential("slash", "slash");

那么如何在WCF中获取这些网络凭据详细信息。

尝试使用OperationContext

OperationContext.Current.ServiceSecurityContext.WindowsIdentity

“slash”是您的windows帐户吗?
OperationContext.Current.ServiceSecurityContext.PrimaryIdentity