Does asp.net identity 2.0 hash passwords different

2019-09-17 20:42发布

问题:

I just updated my app from asp.net identity 1.0 to 2.0 to take advantage of the email confirmation, two-factor auth, etc...

However, user's cannot log in now. It seems await UserManager.FindAsync(model.UserName, model.Password); doesn't find existing users who signed up on identity 1.0... but user's who signed up during identity 2.0 work fine.

回答1:

Hashing is exactly the same.
Identity 2.0 UserManager.FindAsync(UserName, Password) can return null for users registered with Identity 1.0. There are some new fields in the AspNetUsers table which are manadatory - NOT NULL.
Most possible reason is the AccessFailedCount field. If it is null, you don't see any exceptions, only null user.