6

This answer explains that when calling a .asmx web service there's no need to specify which authentication type to use:


WebServiceProxy proxy = new WebServiceProxy(); // Derived from SoapHttpClientProtocol

proxy.Credentials = CredentialCache.DefaultCredentials;

This method works for both NTLM and Kerberos authentication. It will pass the credentials of the windows account under which the code is running.


What is the equivalent in WCF, that works in both NTLM and Kerberos environments?

Community
  • 1
  • 1
Alex Angas
  • 59,219
  • 41
  • 137
  • 210

1 Answers1

5

In WCF you need to specify authentication in the bindings of your WCF services. Make sure the client and server use the same authentication scheme.

web.config:

<binding name="WindowsClientOverTcp">
    <security mode="Transport">
        <transport clientCredentialType="Windows" />
    </security>
</binding>
ericphan
  • 267
  • 2
  • 10
  • So there is no way to avoid specifying the authentication? That is, you need to know if the environment is Kerberos or NTLM? – Alex Angas Nov 19 '10 at 04:22
  • With Kerberos your client and server need to meet some specific conditions before it is used, otherwise the windows authentication will default to use NTLM – ericphan Nov 19 '10 at 05:30