I am testing some proxy settings for our application but I need to test a proxy that requires Windows Authentication (or network credentials).
For testing, I assigned the credential of the proxy to the network credentials
System.Net.WebProxy proxy = new System.Net.WebProxy("127.0.0.1", 8888); proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; //proxy.Credentials = new System.Net.NetworkCredential("1", "1"); System.Net.WebRequest.DefaultWebProxy = proxy;
Currently, I use Fiddler with the Require Proxy Authentication
rule turned on. How can I configure Fiddler so I can use the Windows credentials instead of the default "1" / "1" credentials?
Select the Composer tab. Set the HTTP/HTTPS method to GET and add the URL in the URL field. Create an object in the request Body and the user and passwd variables and their values. In this object, user and passwd are the predefined variables for the Basic Authentication.
In Fiddler 4.6 I can turn on "Automatically Authenticate" under Composer -> Options. My WebAPI hosted in IIS using Windows Authentication is then successfully called. You can see three requests in the log for a single call.
HTTP/1.1 401 Unauthorized Cache-Control: private Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/10.0 WWW-Authenticate: Negotiate WWW-Authenticate: NTLM
HTTP/1.1 401 Unauthorized Content-Type: text/html; charset=us-ascii Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: Negotiate oYIBDTCCAQ... Date: Mon, 18 Jan 2016 09:38:22 GMT Content-Length: 341
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Expires: -1 Server: Microsoft-IIS/10.0 X-AspNet-Version: 4.0.30319 Persistent-Auth: true WWW-Authenticate: Negotiate oRsw... Date: Mon, 18 Jan 2016 09:38:22 GMT Content-Length: 4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With