PRB: "Proxy Authentication Required" Error Message with ServerXMLHTTP Object


When you use an Active Server Pages (ASP) application that uses the ServerXMLHTTP object to retrieve data from servers through a proxy server, and the virtual directory or Web site where the application resides is configured for Anonymous access, you may receive the following error message:

Proxy Authentication Required

You must authenticate with a proxy server before this request can be serviced.

Please try the following: Log on to your proxy server and try again. If you believe you should be able to view this directory or page, please contact the Web site administrator by using the e-mail address or phone number listed on the MyServer <http://MyServer> home page.

HTTP 407 - Proxy Authentication Required
This problem may persist even if the server is using the correct proxy settings through Proxycfg, and even if the application is passing proxy credentials with the setProxyCredentials method.


This problem occurs with proxy servers that use Microsoft Windows NT Challenge/Response (NTLM) authentication. When the application requests access to external Web sites, the proxy server sends a "challenge," requesting the credentials of the user who wants this access. Because the authentication method of the Web site is Anonymous, Internet Information Services (IIS) replies with the credentials of the anonymous account (IUSR_MachineName). By default, IUSR_MachineName is a local account known only to the IIS server. The proxy server refuses access because it does not recognize the name.

This applies to both IIS versions 4.0 and 5.0.


Make sure that the Account Used for Anonymous Access property of the virtual directory or Web site is set to a domain account. By default, this is set to a local account.


This behavior is by design.

More Information

Steps to Reproduce the Behavior

NOTE: You need to have knowledge of proxy servers and IIS servers to test this procedure.

  1. Set up a proxy server and set it to use only NTLM authentication.
  2. Configure a virtual directory in IIS to allow Anonymous access with the default anonymous account (IUSR_MachineName).
  3. In the virtual directory, create an ASP page that accesses a server through the proxy server that you configured in step 1. The following sample ASP code uses Microsoft Visual Basic Scripting Edition (VBScript):
    Dim xmlServerHttp
    set xmlServerHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0") "GET", "", False
    xmlServerHttp.setProxyCredentials "myUser", "myPassword"
    Response.Write xmlServerHttp.responsetext


For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

290761 Frequently Asked Questions about ServerXMLHTTP
309436 PRB: Users Are Prompted for Credentials When Using XMLHTTP or ServerXMLHTTP to Access Remote Pages
291008 PRB: 'Access Denied' Error Message When Using ServerXMLHTTP to Access an Authenticated Site
289481 INFO: Proxy Configuration Utility Must Be Run for ServerXMLHTTP to Work

ID do Artigo: 315909 - Última Revisão: 22 de jun de 2014 - Revisão: 1