0
나는 무작위로 사용자를 수락하는 웹 사이트가 있다고 가정합니다. 규칙은 간단합니다. 임의 생성기는 사용자가 로그인 할 수 있는지 여부를 알 수 있습니다.새로운 OWIN Identity API로 로그인하십시오.
이 코드는 어떻게 사용해야합니까?
private async Task SignInAsync(ApplicationUser user, bool isPersistent)
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
HttpContext.GetOwinContext().SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
}
저는 ApplicationUser가 없으므로 DbContext를 주입하지 않았으며 사용자 (!) 테이블이 없습니다.
주요 질문; 간단한 인증은 어디에 있습니까?
FormsAuthentication.RedirectFromLoginPage ("I_am_a_User", Persist.Checked)