In the non-Core version of Identity, PasswordHasher is a non-generic type. Its HashPassword
method takes a single argument (the password to hash), and its VerifyHashedPassword
method takes only two (the password hash generated previously by HashPassword
, and the provided password to verify. This is great, because it means that I can use PasswordHasher
without going all-in and using the whole Identity framework.
In Microsoft.AspNetCore.Identity
, on the other hand, PasswordHasher<TUser>
is now a generic class, and the HashPassword
and VerifyHashedPassword
methods take a user
parameter in addition to the parameters that existed previously. This doesn't make much sense to me. Why does either hashing a password or verifying a hash require the user object? What's it used for?