public async Task<ActionResult> Login()
{
AuthenticationManager authentication = Request.HttpContext.Authentication;
if (Request.Method == "POST")
{
var isPersistent = !string.IsNullOrEmpty(Request.Form["isPersistent"]);
if (!string.IsNullOrEmpty(Request.Form["submit.Signin"]))
{
var authenticationPrincipal = new ClaimsPrincipal(new[] { new ClaimsIdentity(new[] { new Claim(ClaimsIdentity.DefaultNameClaimType, Request.Form["username"]) }, "Application") });
await authentication.SignInAsync("Application", authenticationPrincipal, new AuthenticationProperties { IsPersistent = isPersistent });
}
}
return View();
}