473,799 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpWebRequest PreAuthenticate not working for Digest Authentication?

I am using the following code to retrieve a document from my web
server:

HttpWebRequest req =
(HttpWebRequest )WebRequest.Cre ate("http://example.com/");
req.Method = "GET";
req.PreAuthenti cate = true;
req.Credentials = new NetworkCredenti al("user", "pass");
HttpWebResponse res = (HttpWebRespons e)req.GetRespon se();
res.Close();

When setting my web server to require Basic Authentication, multiple
executions result in the following log entries:
401 Authentication Required
200 OK
200 OK
200 OK

However, when setting my web server to require Digest Authentication,
multiple executions result in:
401 Authentication Required
200 OK
401 Authentication Required
200 OK
401 Authentication Required
200 OK

Seems like old authentication information is not used for new querys to
the same URI.

I also tried using

req.Credentials = new NetworkCredenti al("user", "pass", "example.co m");

but to no avail. This is quite frustrating, as a HTTP PUT to the server
can now only be performed with AllowWriteStrea mBuffering set to false.
Did I simply overlook something, or is PreAuthenticate not available
for Digest Authentication?

How can I PUT a file to a server using Digest Authentication while
having AllowWriteStrea mBuffering set to false?
I am really hoping someone can help!

Kind regards,

Wolf

Nov 11 '05 #1
0 2337

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3228
by: Satinderpal Singh | last post by:
Hi everyone, We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value in a variable and make the request again with that cookie as a header value (Digest Authentication). But, the problem we are facing is: That the HttpWebRequest is getting two responses simultaneously, which means that the code should wait after...
1
2803
by: Satinderpal Singh | last post by:
Hi everyone, We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value in a variable and make the request again with that cookie as a header value (Digest Authentication). But, the problem we are facing is: That the HttpWebRequest is getting two responses simultaneously, which means that the code should wait after the...
0
2376
by: Pmcg | last post by:
I would appreciate any help with the following, havn't found any answers for this in my research to date. I am trying to retreive a web page (a htm file intially) from a vdir on an intranet site using the following code, where the vdir has "Integrated Windows authentication" turned on but "Anonymous access" turned off, i get the following message The remote server returned an error: (401) Unauthorized. If i use the browser i can see the...
8
3641
by: Noel Volin | last post by:
Anyone who can help here is much appreciated. I am trying to programmatically log onto a website. I am using the code provided in VS for the AuthenticationManager Class example ( ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemNetAuthenticationManagerClassTopic.htm ). I have also download and tried to use the following CsharpHttp executable in an attempt to find my problem:...
0
432
by: Wolfgang Meier | last post by:
I am using the following code to retrieve a document from my web server: HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://example.com/"); req.Method = "GET"; req.PreAuthenticate = true; req.Credentials = new NetworkCredential("user", "pass"); HttpWebResponse res = (HttpWebResponse)req.GetResponse(); res.Close();
1
1636
by: cowbell | last post by:
Providing authentication for protected content via Basic/Digest Headers seems pretty straight-forward, but I'm stuck trying to figure out how to do something a little different: say you have some sort of page of customizable content - an example might be a portal page that you've tweaked to display your favorite headline topics, your stock portfolio, etc. The page itself isn't protected so you won't be challenged when you hit that site,...
5
4872
by: mr.newsgroupguy | last post by:
I am working in C# .NET 1.1. My app has a button on its main form that checks to see if it has access to a file on our server, just an XML file. On our server we are running W2K IIS with a virtual directory, set to Windows Authentication. I am creating an HTTPWebRequest object on the client, and setting its Credentials to CredentialCache.DefaultCredentials. Also, I have tried numerous Timeout settings, but they have not made a...
2
8184
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of a new proxy server on our internal network with 407 Proxy Authentication Required. The same request through the old proxy succeeds. The same request to an HTTP address through the new proxy succeeds. Also, the request succeeds when forced to use Basic authentication but fails on NTLM.
0
1519
by: Marc J. Cawood | last post by:
We're calling a Web Service from a VB.NET application (written with VS2005) but no authentication headers are being sent even with PreAuthenticate = True. EOS.PreAuthenticate = True EOS.Credentials = New System.Net.NetworkCredential("user1", "xxxxxxx") We've examined the request headers with Fiddler and no headers are present. We were under the impression that PreAuthenticate forced authentication:
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.