public ActionResult Login(AuthenticateChallengeModel model) { if (ModelState.IsValid && Authentication.Login(model).IsSuccess) { return(RedirectToAction("Index", "Home")); } return(View(model)); }
/// <summary> /// <para>ユーザーの認可判定.</para> /// </summary> /// <param name="model"></param> /// <returns></returns> public AuthenticateResultModel Authenticate(AuthenticateChallengeModel model) { bool result = false; var user = UserMng.FindAsync(model.UserName, model.Password).Result; if (user != null) { var identity = UserMng.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie).Result; HttpContext.Current.GetOwinContext().Authentication.SignIn(identity); result = true; } return(AuthenticateResultModel.Create(model, result)); }
public AuthenticateResultModel Login(AuthenticateChallengeModel model) { return(AuthSvc.Authenticate(model)); }