代码之家  ›  专栏  ›  技术社区  ›  Pierre-Alain Vigeant

在Windows身份验证中使用Fiddler

  •  21
  • Pierre-Alain Vigeant  · 技术社区  · 14 年前

    我正在测试应用程序的一些代理设置,但我需要测试需要Windows身份验证(或网络凭据)的代理。

    为了测试,我将代理的凭据分配给了网络凭据。

    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;
    

    目前,我用小提琴 Require Proxy Authentication 规则已打开。如何配置fiddler,以便使用Windows凭据而不是默认的“1”/“1”凭据?

    3 回复  |  直到 9 年前
        1
  •  36
  •   Eivind Gussiås Løkseth    9 年前

    在Fiddler 4.6中,我可以在Composer->选项下打开“自动验证”。然后成功调用使用Windows身份验证托管在IIS中的WebAPI。您可以在日志中看到一次呼叫的三个请求。

    1. 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

    2. 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

    3. 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

        2
  •  6
  •   EricLaw    14 年前

    使用fiddler不容易做到这一点;您需要自己计算凭证质询,并在使用代理authenticate:negotiate头返回HTTP/407响应后将质询添加到响应头中。

    相比之下,简单的响应头支持基本身份验证,这就是fiddler的“需要代理身份验证”功能的工作原理。

        3
  •  1
  •   Phillip Ngan    12 年前

    WebMarshal是在Windows上运行的Web代理。它可以配置为使用基本身份验证和NTLM身份验证。你可以 download a free trial .