Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Change Password using ASP.Net Identity

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 10.7k
    Comment on it

    Change password is a common functionality which is used in almost every app that takes user credentials to login.

    In ASP.Net Identity, we have the inbuilt method to change the password of currently logged in user.

    Here is the sample code for the same

      IdentityResult result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), oldPassword, newPassword);

    Here we are making a request for changing the password using currently logged in userId(User.Identity.GetUserId()), oldPassword and newPassword as parameter.  ChangePasswordAsync is a method of ApplicationUserManager which has methods for all the functionality related to user account

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: