title: Web application using Windows authentication can't go through proxy
body: <p>I have an MVC4 application that is using Windows authentication. This application scrapes a variety of internet sites. This application is hosted in our intranet and needs to go through our corporate proxy to access the internet. Through some debugging I can see that I'm fully authenticated by user id and that I'm impersonating. My problem is that I keep receiving error <code>The remote server returned an error: (407) Proxy Authentication Required.</code>. I can verify that my code works because it works as expected if I hard code my credentials for the proxy.</p>
  
  <pre><code>var windowsIdentity = (WindowsIdentity) HttpContext.Current.User.Identity;
  using (windowsIdentity.Impersonate())
  {
      var webClient = new WebClient
          {
              Proxy = new WebProxy(PROXY)
                  {
                      Credentials = CredentialCache.DefaultNetworkCredentials
                  }
          };
      var str = webClient.DownloadString("http://google.com");
  }
  </code></pre>
  
  <p>Using <code>CredentialCache.DefaultCredentials</code> also does not work. Why can't I impersonate myself (or whoever is accessing the site) and use that user to authenticate against the proxy?</p>