Kieron
Kieron

Reputation: 27127

Forms Authentication and HttpWebRequest

I need to be able to login to a site via Forms Authentication using a HttpWebRequest.

Currently, when I provide NetworkCreditials to the request, it just redirects me to the Login page, which makes sense...but how do I go about ensuring that the request correctly authenticates without redirecting?

Thanks

Upvotes: 1

Views: 1259

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039548

If the site uses cookies to tracks users you need to use a cookie container in order to store the authentication cookie emitted by the server and reuse this cookie in later requests to access authenticated parts of the site.

Upvotes: 1

Related Questions