2012-09-20 5 views
1

netTcpBinding을 사용하여 자체 호스팅 WCF 서비스를 보유하고 있습니다. 서비스를 호출하는 클라이언트의 도메인 사용자 이름에 액세스하는 데 사용할 수있는 클래스가 있습니까? 나는 OperationContext을 보았지만 알아 내지 못했습니다. 감사합니다WCF netTcpBinding 사용자 이름 얻기

답변

1

이 시도 :

ServiceSecurityContext serviceSecurityContext = ServiceSecurityContext.Current; 
if (serviceSecurityContext != null) 
{ 
    string accountText = serviceSecurityContext.WindowsIdentity.Name; 
} 

WindowsIdentity 속성은 사용자에 대한 정보가 많이 포함되어 있습니다.

+0

감사합니다. 이것은 내가 찾고있는 것입니다. – swiftgp

관련 문제