Beispiel #1
0
 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
 {
     if (Autentificacion.Autenticar(Login1.UserName, Login1.Password))//llamamos al a funcion autentificar, donde se hara la consulta  ala bd
     {
         FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
     }
 }
Beispiel #2
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string sal  = Autentificacion.getSalt(txtUserName.Text.Trim());
        string hash = txtHash.Value;

        if (this.txtUserName.Text == "Admin1")
        {
            if (this.txtPass.Value.Equals("Admin123456"))
            {
                Session["userlogin"] = "******";
                Response.Redirect("principal.aspx");
            }
            else
            {
                Response.Redirect("Login.aspx");
            }
        }
        else if (Autentificacion.Autenticar(txtUserName.Text.Trim(), Seguridad.SHA512(hash + sal)))
        {
            Session["userlogin"] = "******";
            Response.Redirect("principal.aspx");
        }
        else
        {
            Response.Redirect("Login.aspx");
        }
    }
 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
 {
     if (Autentificacion.Autenticar(Login1.UserName, getSha1(Login1.Password)))
     {
         FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
     }
     else
     {
         Login1.FailureText = "El intento de conexión no fue correcto. Inténtelo de nuevo.";
     }
 }