Error 401.1 WinHttp.WinHttpRequest.5.1 in classic asp site

Pagina: 1
Acties:
  • 836 views

Onderwerpen


Acties:
  • 0 Henk 'm!

  • barteke
  • Registratie: September 2002
  • Laatst online: 25-06-2023
Excuses dat onderstaande in het Engels is, maar ik heb het ook al gepost op internationale fora. Ik gok dat het voor de meeste van jullie geen probleem zal zijn.


General information

Operating System: Windows Server 2003 R2 Service pack 2
Webserver: IIS 6
NTAuthenticationProviders: NTLM only
Webapplication: Classic ASP
Browsers used: IE7, IE8, IE9

There’s a web application, let’s call it myWebapp, within a website , let’s call it myWebsite.

myWebsite has anonymous access AND Integrated Windows Authentication enabled.
myWebapp has anonymous access disabled and Integrated Windows Authentication enabled

myWebapp is a Classic ASP application has its own Application pool which runs under the predefined Application pool identity “Network service”

When I’m logged in with my NT account I can access any page I want just fine. The problem is with the WinHttp.WinHttpRequest.5.1 component. It’s used in some parts of myWepapp to do a server side request to retrieve content from some .asp scripts which reside within the web application.

The problem started when Anonymous access was turned off on the Webapplication. Note, turning it back on is not an option.

Example of a request using WinHttpRequest:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
set WinHTTPRequest = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
                    
WinHTTPRequest.SetTimeouts 20000, 20000, 20000, 20000
                    
call WinHTTPRequest.Open("POST", someUrlToAspScript, false) 
                    
WinHTTPRequest.SetAutoLogonPolicy 0                 
                    
WinHTTPRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
                    
WinHTTPRequest.Send strQueryString

Response.Write(WinHTTPRequest.ResponseText)


With SetAutoLoginPolicy set to 0, I get the following error message on the pages where WinHttpRequest is used:

You do not have permission to view this directory or page using the credentials that you supplied.
HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.


With SetAutoLoginPolicy set to 2 (Do not automatically send user credentials according to MSDN), I get the following error message on the pages where WinHttpRequest is used:

You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.
HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration.


I know for a fact that my NT user account has the proper rights to access those .asp scripts and so does the Network Service account.

I tried figuring out what could be the problem for several days know, tried setting the NTAuthenticationProviders to only NTLM and both Negotiate and NTLM amongst other things, but nothing worked so far.

Please help me out, It’s starting to drive me crazy.

dank en groet,

Barteke

I am a rock, I am an Island, and a rock feels no pain and an Island never cries


Acties:
  • 0 Henk 'm!

  • Koffie
  • Registratie: Augustus 2000
  • Laatst online: 06-06 21:45

Koffie

Koffiebierbrouwer

Braaimeneer

Sorry, maar we verwachten toch echt een Nederlandse post. We zijn geen internationaal forum, maar een Nederlands forum.

Zwembad (te koop) - Braaihok (te koop) - Bouwproject -BraaiTV - Funda


Dit topic is gesloten.