public void Application_PostAuthenticateRequest() { HttpCookie cookie = Request.Cookies["TicketEmpleado"]; if (cookie != null) { FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); String username = ticket.Name; int emp_no = int.Parse(ticket.UserData); GenericIdentity identidad = new GenericIdentity(username); RepositoryEmpleados repo = new RepositoryEmpleados(); Empleado empleado = repo.BuscarEmpleado(emp_no); HttpContext.Current.User = empleado; } }
//SI NO ESCRIBIMOS BIEN EL METODO, NOS QUEDAMOS EN LOGIN public void Application_PostAuthenticateRequest() { HttpCookie cookie = Request.Cookies["TICKETEMPLEADO"]; if (cookie != null) { String datos = cookie.Value; FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(datos); int empno = int.Parse(ticket.UserData); String username = ticket.Name; GenericIdentity identity = new GenericIdentity(username); //GenericPrincipal usuario = new GenericPrincipal(identity, roles); //DE DONDE SACO ESTE EMPLEADO? RepositoryEmpleados repo = new RepositoryEmpleados(); Empleados empleado = repo.BuscarEmpleado(empno); empleado.Identity = identity; HttpContext.Current.User = empleado; } }
public ServiceEmpleados() { this.repo = new RepositoryEmpleados(); }
public IdentityController(RepositoryEmpleados repo) { this.repo = repo; }
public AuthController(RepositoryEmpleados repo , HelperToken helpertoken) { this.repo = repo; this.helpertoken = helpertoken; }
public EmpleadosController(RepositoryEmpleados repo) { this.repo = repo; }
public EmpleadosController() { this.repo = new RepositoryEmpleados(); }
public ValidacionController() { repo = new RepositoryEmpleados(); }
public AutorizacionEmpleadosToken() { this.repo = new RepositoryEmpleados(); }
public PracticaAjaxController() { this.repo = new RepositoryEmpleados(); }
public AuthController(RepositoryEmpleados repo , IConfiguration configuration) { this.configuration = configuration; this.repo = repo; }