Opusretis
asked on
ASP.NET Membership Login Programmatically
I've got a ASP.NET Webapplication with ASP.NET Membership Provider for User and Rolemanagement.
There is also an second Project, something like a Webspider.
The Spider should read periodically the content of the Webapplication.
In the Page_Load Event of the Webapp Login-Page I check a Querystring (Something like an API-Key). If this query string is there I use the FormsAuthentication.SetAut hCookie Method to Login a special User. If I test this directly in the browser, the login is working fine and I can access the other sites. If I try to do so with the spider I get only the content of the Login Page, even if I try to access other pages after I did the login. I use for this a WebClient Object:
Is it possible that the WebClient doesn't support the AuthCookie? How can I solve my problem?
There is also an second Project, something like a Webspider.
The Spider should read periodically the content of the Webapplication.
In the Page_Load Event of the Webapp Login-Page I check a Querystring (Something like an API-Key). If this query string is there I use the FormsAuthentication.SetAut
WebClient client = new WebClient();
string s = client.DownloadString("http://localhost:50125/Account/Login.aspx?Pass=123");
s = client.DownloadString("http://localhost:50125/Default.aspx");
Is it possible that the WebClient doesn't support the AuthCookie? How can I solve my problem?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.