Hey folks,
I'm trying to use the HttpWebResponse object in an ASP application, but I
get a 401 unauthorized error on this line:
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
I have:
identity impersonate = true
authentication mode = windows
IIS set to use windows authentication
and I set: webRequest.Credentials = CredentialCache.DefaultCredentials;
This works when I run the page from the server, but from a remote machine it
gives me the unauthorized error. However, if in the web config file I
specify identity impersonate = true with a username and password, then it
works fine. I don't want to do this however.
Is there any way to avoid specifying a username and password in the
web.config and without setting up delegation on the server (not an option)?
Thanks!