Authenticate on an ASP.Net Forms Authorization website from a console app

0 votes
I'm trying to build a C# console application to automate grabbing certain files from our website, mostly to save myself clicks and - frankly - just to have done it. But I've hit a snag that for which I've been unable to find a working solution.

The website I'm trying to which I'm trying to connect uses ASP.Net forms authorization, and I cannot figure out how to authenticate myself with it. This application is a complete hack so I can hard code my username and password or any other needed auth info, and the solution itself doesn't need to be something that is viable enough to release to general users. In other words, if the only possible solution is a hack, I'm fine with that.

Basically, I'm trying to use HttpWebRequest to pull the site that has the list of files, iterating through that list and then downloading what I need. So the actual work on the site is fairly trivial once I can get the website to consider me authorized.
Sep 20, 2018 in IoT (Internet of Things) by Upasana
• 8,530 points
34 views

1 answer to this question.

0 votes

Essentially, we need to record a regular user session. I would recommend Fiddler http://www.fiddler2.com but if you're on linux or something, then you'll need to use Wireshark to figure some of the things out. Not sure if there is a firefox plugin that could be used.

Anyway, 

  1. Start up IE, then start up Fiddler. 
  2. Complete the login process. Stop what you're doing. 
  3. Switch to the fiddler pane, and examine the recorded sessions in detail. 

It should give you exactly what you need to fake using WebRequests.

answered Sep 20, 2018 by Annie97
• 2,190 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer
0 votes
1 answer

How to prevent an application from publishing to a topic?

Devices and applications operate in a topic ...READ MORE

answered Jan 18 in IoT (Internet of Things) by Shubham
• 13,290 points
17 views
0 votes
1 answer
0 votes
1 answer

Display time in a Windows Core IoT app with a clock!

It is possible, but you should understand ...READ MORE

answered Jul 9, 2018 in IoT (Internet of Things) by nirvana
• 3,060 points
92 views
0 votes
1 answer
0 votes
1 answer

Is there a .NET equivalent to Apache Hadoop?

Microsoft dropped its alternative (Dryad) in favor of Hadoop. ...READ MORE

answered Sep 18, 2018 in Big Data Hadoop by Frankie
• 9,810 points
43 views
0 votes
1 answer

Validate String against USPS State Abbreviations

Try something like this: private static String states ...READ MORE

answered Sep 20, 2018 in IoT (Internet of Things) by Annie97
• 2,190 points
22 views
0 votes
1 answer

How to use jquery with asp.net ajax?

If you weren't aware, Microsoft is planning ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by Annie97
• 2,190 points
28 views