Asp.net identity encrypt password -
i using asp.net identity , need encrypt password compare passwordhash exist in database.
this code :
var passhash = new passwordhasher().hashpassword("123456"); using (efdbcontext _db = new efdbcontext()) { var users = _db.users.where(u => u.passwordhash == passhash); }
i getting empty result, in database exist user has password "123456"
password hashes compared using method verifyhashedpassword passwordhasher class why code not working, check link:
if have retrieve users using password, think can't using ef (it can't translate verifyhashedpassword method sql query), have retrieve users , compare password each one.
if want retrieve single user search email , compare password using verifyhashedpassword.
Comments
Post a Comment