ASP.NET Identity Provider SignInManager Keeps Returning Failure

后端 未结 10 1666
天涯浪人
天涯浪人 2021-01-31 15:52

I have an issue with the standard ASP Identity provider for MVC5. As soon as I log in the method:

await SignInManager.PasswordSignInAsync(model.Email, model.Pass         


        
10条回答
  •  甜味超标
    2021-01-31 16:17

    ApplicationUser signedUser = UserManager.FindByEmail(model.Email);
    var result = await SignInManager.PasswordSignInAsync(signedUser.UserName, 
    model.Password, model.RememberMe, shouldLockout: false);
    

    This worked for me becouse my username was not equal my email. Your email and username should be the same.

提交回复
热议问题