1

I am creating an application in which the administrator must have the privilege of resetting the password of other users. I don't want to reset their passwords. I just want the administrator to be able to change the password of everyone without knowing their old password.

How can i change the password without knowing the old password. I am using asp.net mvc 4 and the simple membership provider.

I also have no configuration in web.config for the membership provider.

Aqil Azad
  • 45
  • 8
  • 3
    try looking at [THIS ONE][1] I think it's the same as your question. [1]: http://stackoverflow.com/questions/5013901/asp-net-membership-change-password-without-knowing-old-one – Crystal Maiden Apr 06 '13 at 08:21
  • That does not work for me, as I am using simple membership provider – Aqil Azad Apr 06 '13 at 09:22
  • @AqilAzad This shouldn't have been marked as a duplicate; the simple membership provider does not support password resetting as explained in the linked question. The solution is similar, however (I'd make it an answer, but this question appears to be locked now): `string token = WebSecurity.GeneratePasswordResetToken(username); WebSecurity.ResetPassword(token, newpassword);` – grant May 19 '13 at 03:08

1 Answers1

0

in Asp.Net if you want to change the password of the users...

You need to only know the Id(Username) of the person. This must be Unique and you must have already decided this in your database.

Through coding you could run a query of 'update' the Password of that Username, if you have provided all the privileges to the admin.

Hope this answers your Question.

Ashish
  • 1,899
  • 20
  • 22