I have the following setup:
- Server machine running a WCF service exposed via an IIS application that requires Windows authentication.
- A proxy server (Squid) requiring Windows authentication.
- A client machine running a Windows service which tries to make a connection to the WCF service through the proxy server. The service is set with a domain account credentials.
All machines are on the same domain. If I drop the proxy from the setup and set just the following properties on the client security binding, all works well:
- SecurityMode = TransportCredentialOnly
- Transport.ClientCredentialType = Windows
The connection is made successfully and the correct credentials are passed to the server.
If I add the proxy but drop the required Windows authentication on the proxy server, everything works fine too. The only setting I change here on the security binding is:
ProxyAddress = http://myproxyserver:3128
I can see the calls go through the proxy server with the correct credentials.
The problem is that when I set the Windows authentication requirement on the proxy server, the proxy server returns 407 error. When I check the log files, I can see there is no second attempt to respond to the 407 error with the correct credentials. The setting I add is:
Transport.ProxyCredentialType = Windows
Things I tried and didn't work:
- Set UseDefaultProxy - since this is a Windows service, it doesn't accept the default proxy.
- Manually set Windows Credentials in ClientCredentials.Windows (including domain).
- Add default proxy in app.config and machine.config.
Any ideas on what's going on and how to fix it?