Skip to content

[C#] HTTPwebrequest Multiple Authentications

Dan Raby

Asked Aug 11, 2008, 6:24 PM EDT1 answer
Share
LinkedInX
I am creating a Windows Form App that reaches out to 2 devices every 3 seconds and pulls an XML file, parses the stats, and raises alarms. The devices that I am pulling the xml files from are password protected with Digest (nonce).

1. Send the first HTTP request
2. Catch the WebException and parse the 401 error for the nonce.
3. Generate the response.
4. Send the revised Request.

The problem I am having is that I have to do this every time I update the stats.

When I get the xml from a web browser, I only have to authenticate once, and it saves it. I am hoping there is a way to create a session or something so I don't have to repeat this 2 times every 3 seconds for 6 hours.

I have code to post. I am hoping it is something that can be solved without it.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I have solved my problem!

    As all authentications can vary, I had to run a packet tracer and read how each additional authenticated request was sent.  If you have any questions, post a reply.
    0