Hi, I have a question about logging into web forms, my login works perfectly this way:
And when clicking, it calls a class that validates and returns true or false, according to the credentials sent and consulted in the "Users" database Login.cs:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Autenticado = false;
cls_login validacion = new cls_login();
Autenticado = validacion.validar(Login1.UserName, Login1.Password);
if (Autenticado) {
e.Authenticated = Autenticado;
}
}
The problem is that I'm doing an extension for Chrome, where the Popup is open iframe to the web page of my WebForms application, where obviously opens the login page, where they log in and everything works perfectly .
The annoying thing is that I would like that every time they open the extension they avoid having to log in.
I would not like the webforms application to have the session never expire, but rather my solution was that in the options of my extension I saved the username and password and using javascript ajax , I will call a < strong> WebHandler where it receives the credentials and will log in, but I can not do it since I do not have the same events as in my login.cs:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
To date I have been able to call my WebHandler using JS (from the chrome extension), it has received the parameters correctly, it has called my validation class that is in turn queries the base of data in SQL, and the Handler returns true or false, which likewise works correctly.
My question is how can I generate a "login" in a class?