Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 363
Alex Angas Avatar asked Nov 19 '10 03:11

Alex Angas


People also ask

How will you implement basic authentication in WCF service?

To be able to integrate Basic Authentication with WCF REST, we have to extend the functionality of the WCF framework. The extension is divided into three steps: Find the extension point to apply behavior to all operations of the service. Create a custom authentication mechanism based on existing standards.

How do I change my WCF username and password?

To configure a service to authenticate its clients using Windows Domain username and passwords use the WSHttpBinding and set its Security. Mode property to Message . In addition you must specify an X509 certificate that will be used to encrypt the username and password as they are sent from the client to the service.


1 Answers

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>
like image 113
ericphan Avatar answered Nov 15 '22 04:11

ericphan