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,620 points
887 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,160 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, 2019 in IoT (Internet of Things) by Shubham
• 13,490 points
665 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 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,539 views
0 votes
1 answer

Writing SEO friendly url gets infinite loop asp.net

you should know that regex avoid cases ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 63,680 points
776 views
0 votes
0 answers

How to get Bitcoin value for corresponding USD value in ASP.NET C#?

I want to get the Bitcoin value ...READ MORE

Mar 1, 2022 in Blockchain by Soham
• 9,710 points
799 views
0 votes
0 answers

The request was aborted: Could not create SSL/TLS secure channel

When I connect to an  HTTPS server ...READ MORE

May 1, 2022 in Other DevOps Questions by Kichu
• 19,050 points
1,946 views
0 votes
0 answers

No connection could be made because the target machine actively refused it?

 I was doing HttpWebRequest to a WebService ...READ MORE

May 5, 2022 in Others by Kichu
• 19,050 points
2,766 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,160 points
728 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP