401 Unauthorized on HttpWebRequest with DefaultCredentials (2003)
- From: ivarley@xxxxxxxxxxx
- Date: 28 Mar 2006 10:07:38 -0800
Hi all,
In moving an app from server 2000 to server 2003, we started getting
errors from this code. It pulls a page (on the same web server) using a
web request. This is an intranet site, and integrated windows
authentication is turned on. Same exact code works fine on a Windows
2000 server.
The error is: "The remote server returned an error message: 401
Unauthorized". Can anybody point us to what might be configured wrong?
Thanks,
Ian
//--------------------------------------------------
using System.Net;
using System.IO;
//...
private string GetWebPage(string url)
{
HttpWebRequest w = (HttpWebRequest)WebRequest.Create(url);
w.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse r =(HttpWebResponse)w.GetResponse();
StreamReader webstream = new StreamReader(r.GetResponseStream(),
System.Text.Encoding.Default);
//....
}
//--------------------------------------------------
.
- Follow-Ups:
- Prev by Date: Re: Web Server connecting to db server on different machines
- Next by Date: VB 2005 .net- Login control - how do I validate user no / password against SQL server
- Previous by thread: Re: Web Server connecting to db server on different machines
- Next by thread: Re: 401 Unauthorized on HttpWebRequest with DefaultCredentials (2003)
- Index(es):
Relevant Pages
|
|