Change password based on current password

web dev asked on May 19, 2020 16:37

Hello i have a for that contain changing password

Current user password

new password

confirm password

I am using kentico mvc what is the best implementation for that thanks

Correct Answer

David te Kloese answered on May 25, 2020 14:31

First check if password is correct by just authenticating the User:

user = AuthenticationHelper.AuthenticateUser("username", "password", SiteContext.CurrentSiteName);

If user is returned you can update it's password:

CMS.Membership.UserInfoProvider.SetPassword("UserName", "Password");

Kentico API should handle the encryption settings

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.