问题描述
我对MVC5的标准ASP身份提供程序有疑问.一旦我登录方法:
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.Password, model.RememberMe, shouldLockout: false);
保持返回失败.所以我开始调试,方法是:
keeps returning Failure. So I started debugging, By using:
UserManager.FindByEmail(model.Email);
这将为尝试登录的用户返回有效的用户ID.然后我用了:
This returns a valid UserID for my user trying to log in.Then I used:
SignInManager.UserManager.CheckPassword(UserIDObtainedFromFind, model.Password);
这将返回true,这意味着我提供的密码是有效的....
And this returns true, which means that the password I provide is valid....
关于如何跟踪,调试 SignInManager.PasswordSignInAsync 方法以查看失败的任何想法?
Any ideas on how I can trace, of debug the SignInManager.PasswordSignInAsync method to see where it fails?
推荐答案
SignInManager.PasswordSignIn不能使用用户名,您应仔细检查用户名是否与所传递的电子邮件相同.
SignInManager.PasswordSignIn works off of user name, you should double check that the user name is the same as the email you are passing in.
这篇关于ASP.NET身份提供程序SignInManager不断返回失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!