Authentication from ASP.NET to NT4 IIS hangs then timesout

From: Dave Kolb (Dave.Kolb@sas.com)
Date: 06/21/02


From: "Dave Kolb" <Dave.Kolb@sas.com>
Date: Fri, 21 Jun 2002 12:36:13 -0400


I have tried everyway I can think of to get my local W2K machine based
ASP.NET application to authenticate to another one of our NT4 IIS servers
and either fail immediately with an "unauthorized" exception if I give it a
bad password (expected) or hang till I timeout if I give it a good password.
I can use this same technique to hit a Unix web server no problem. Any
ideas? The target NT4 IIS server allows basic and windows authentication. If
I try the same thing with a URL GET type request from the browser it works
fine. I get prompted for the userid, pw and domain. In fact it works even if
I just hit enter without entering anything at the authentication prompt.

Thanks,
Dave Kolb

' tried without a cache at first
'client.Credentials = CredentialCache.DefaultCredentials ' gets
"unauthorized" as does no credentials
'client.Credentials = New Net.NetworkCredential("uuu", "ppp", "xxx") ' hangs
and gets timeout
'resp = client.UploadValues("http://nampub.pc.sas.com/sww-bin/broker.exe/",
"POST", data)

' then tried with a cache to try to force basic authentication in case there
was some sort of deleagation problem between W2K and NT4
Dim myCache As New CredentialCache()
'myCache.Add(New Uri("http://nampub.pc.sas.com/"), "Basic", New
NetworkCredential("uuu", "ppp")) ' hangs
'myCache.Add(New Uri("http://nampub.pc.sas.com/"), "Basic", New
NetworkCredential("uuu", "ppp", "ddd")) ' hangs
'myCache.Add(New Uri("http://nampub.pc.sas.com/"), "Ntlm", New
NetworkCredential("uuu", "ppp", "ddd")) ' hangs
client.Credentials = myCache

' then do a post
resp = client.UploadValues("http://nampub.pc.sas.com/sww-bin/broker.exe/",
"POST", data)