4

I have 2 projects. One of them is using ASP.Net authentication, the other uses Windows authentication, which is the administration side. I want the Admin project to be able to manage the users of the other. I can modify everything except the password.

If I use UserManager.PasswordHasher to create a new hash and update the AspNetUser, I cannot login with the new password (I can see the update has occurred). I tried to incorporate Asp.Net users in the admin project but it's messing with the Windows authentication.

Is this a salting issue? Is there a way to do a simple model update that will update the password hash correctly without re-implementing the entire Identity model?

sreimer
  • 4,913
  • 2
  • 33
  • 43

1 Answers1

6

Something like should work:

user.PasswordHash = UserManager.PasswordHasher.HashPassword(newPassword);
UserManager.Update(User);
Hao Kung
  • 28,040
  • 6
  • 84
  • 93