2011-10-18 157 views
0

我有一個基於REST的WCF服務。如果客戶端通過的NetworkCredential通過登錄細節,如: -獲取NetworkCredential詳細信息wcf

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

那麼我怎樣才能在WCF這些細節的NetworkCredential。

回答

0

嘗試使用的OperationContext

OperationContext.Current.ServiceSecurityContext.WindowsIdentity 

OperationContext.Current.ServiceSecurityContext.PrimaryIdentity 
+0

對不起,它不工作。 –

+0

是「斜槓」你的Windows帳戶? –

+0

沒有它的自定義用戶名和密碼 –