protected override bool AuthorizeCore(HttpContextBase httpContext) { if (httpContext == null) { throw new ArgumentNullException("httpContext"); } IPrincipal user = httpContext.User; if (!user.Identity.IsAuthenticated) { if (httpContext.Request.Cookies[FormsAuthentication.FormsCookieName] != null) { string cookie = httpContext.Request.Cookies[FormsAuthentication.FormsCookieName].Value; FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie); if (AuthService.ValidateUser(ticket.Name)) { httpContext.User = new GenericPrincipal(new GenericIdentity(ticket.Name), null); user = httpContext.User; } } } if (!AuthService.ValidateUser(user.Identity.Name)) { if (!IsEventual) { return(false); } } return(true); }
protected override bool ValidateUser(string name, string password) { return(AuthService.ValidateUser(name, password)); }