문제

I'm calling a WCF service from a Windows service, and I'd like to authenticate the client through the Windows user that the service is running as.

For various reasons (streaming/SSL, mainly) I have to use anonymous authentication for transport credentials. Is there any way to send my WindowsIdentity through the message, the same way you would normally send ClientCredentials.Username.Username or ClientCredentials.Username.Password?

BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;    
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;            
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;      

ServerContractClient serverConnection = new ServerContractClient(binding, new EndpointAddress(url));

string username = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
serverConnection.ClientCredentials = ???

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top