473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.Create("http://example.com/");
req.Method = "GET";
req.PreAuthenticate = true;
req.Credentials = new NetworkCredential("user", "pass");
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
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 NetworkCredential("user", "pass", "example.com");

but to no avail. This is quite frustrating, as a HTTP PUT to the server
can now only be performed with AllowWriteStreamBuffering 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 AllowWriteStreamBuffering set to false?
I am really hoping someone can help!

Kind regards,

Wolf

Nov 11 '05 #1
0 2288

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

Similar topics

1
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...
1
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...
0
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...
8
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 (...
0
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...
1
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...
5
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...
2
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.