8

I'm developing an MVC 5 web application with an existing database. I'm also using ASP.Net Identity for my Authorisation and Authentication but in database passwords are not Hashed using Identitys default password hasher, i need to change it with my own hasher. any idea?

webber
  • 83
  • 1
  • 3
  • Read: [Encrypt and Decrypt](http://www.aspsnippets.com/Articles/Encrypt-and-Decrypt-Username-or-Password-stored-in-database-in-ASPNet-using-C-and-VBNet.aspx) This will help. – Raktim Biswas Jun 05 '16 at 13:56

1 Answers1

8

After creating UserManager instance, you need to assign the passwordhasher property to your CustomPasswordHasher.

UserManager<ApplicationUser> UserManager = new UserManager<ApplicationUser>(store);
UserManager.PasswordHasher = new CustomPasswordHasher(); 

"CustomPasswordHasher" Class should implement "IPasswordHasher" interface

you can see example here

Community
  • 1
  • 1
Irakli Gabisonia
  • 806
  • 8
  • 19