PRB: "Proxy Authentication Required" Error Message with ServerXMLHTTP Object (315909)



The information in this article applies to:

  • Microsoft XML 3.0
  • Microsoft XML 3.0 SP1
  • Microsoft XML 3.0 SP2
  • Microsoft XML 4.0

This article was previously published under Q315909

SYMPTOMS

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.

CAUSE

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.

RESOLUTION

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.

STATUS

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):
    <%
    Response.ContentType="text/xml" 
    Dim xmlServerHttp 
    set xmlServerHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0") 
    xmlServerHttp.open "GET", "http://www.w3.org/xml/1998/06/diffspec.xsl", False 
    xmlServerHttp.setProxyCredentials "myUser", "myPassword" 
    xmlServerHttp.send 
    Response.Write xmlServerHttp.responsetext
    %>
    
    					

REFERENCES

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


Modification Type:MajorLast Reviewed:5/12/2002
Keywords:kbprb KB315909 kbAudDeveloper