title: Console Application with ASP.NET Authentication
body: <p>Here's the situation, I've got a console application that needs to run once a day and make a few requests to pages that require authentication to view. The pages are hosted in a really basic ASP.Net Web Application.</p>
  
  <p>So, I know that in order for the requests to go through successfully I have to authenticate with the server. So I've hooked up the console application to the ASP.Net Membership Provider I'm using for the web app and it successfully determines if a set of a credentials are valid. However, after calling Membership.ValidateUser() any requests I make just get the login screen. After doing some reading it seems that this is because I'm missing the important cookie information that persists my login or what-have-you.</p>
  
  <p>I'm using a basic WebClient to make the requests and then reading/discarding the result.</p>
  
  <p>So the meat of the question is this: Is there a simple way to validate the login information and hold on to it so that I can make the requests successfully, or is this the exact same case as the other two questions I found that require the WebClient to make a "manual" login request to the login.aspx page and try to hold on to the cookie from there?</p>
  
  <p>The questions I'm referencing are:</p>
  
  <p><a href="https://stackoverflow.com/questions/3774592/authenticating-asp-net-mvc-user-from-a-wpf-application">Authenticating ASP.NET MVC user from a WPF application</a></p>
  
  <p>and</p>
  
  <p><a href="https://stackoverflow.com/questions/2798610/login-to-website-and-use-cookie-to-get-source-for-another-page/2798796#2798796">Login to website and use cookie to get source for another page</a></p>