Alex Angas
Alex Angas

Reputation: 60027

What is the equivalent of passing DefaultCredentials in WCF?

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?

Upvotes: 6

Views: 5865

Answers (1)

ericphan
ericphan

Reputation: 267

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>

Upvotes: 5

Related Questions