public TUser Login(string userName, string password, bool isPersistent, string customData) { string userData; TUser user = ValidateCredentials(userName, password, customData, out userData); if (user != null) { FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( /* version */ 1, userName, DateTime.Now, DateTime.Now.AddMinutes(30), isPersistent, userData, FormsAuthentication.FormsCookiePath); string encryptedTicket = FormsAuthentication.Encrypt(ticket); HttpCookie authCookie = new HttpCookie(FormsAuthentication. FormsCookieName, encryptedTicket); HttpContextBase httpContext = (HttpContextBase)ServiceContext. GetService(typeof(HttpContextBase)); httpContext.Response.Cookies.Add(authCookie); } else { HttpContextBase httpContext = (HttpContextBase) ServiceContext.GetService(typeof(HttpContextBase)); httpContext.AddError(new FormsAuthenticationLogonException( "Username or password is not correct.")); } return(user); }
public override void AddError(Exception errorInfo) { _context.AddError(errorInfo); }
public override void AddError(Exception errorInfo) { proxiedContext.AddError(errorInfo); }
public override void AddError(Exception errorInfo) { _inner.AddError(errorInfo); }
public override void AddError(System.Exception errorInfo) { _httpContext.AddError(errorInfo); }
public override void AddError(Exception errorInfo) { _httpContextBase.AddError(errorInfo); }
public override void AddError(Exception errorInfo) { _innerHttpContext.AddError(errorInfo); }