Forgot Password API

S T asked on January 4, 2022 14:49

Hello, I'm making some API endpoints for a mobile app and I've used this line from the LogonForm.ascx.cs

AuthenticationHelper.ForgottenEmailRequest(value, SiteContext.CurrentSiteName, "LOGONFORM", SendEmailFrom, null, ResetPasswordURL, returnUrl);

With the kentico logon webpart when you submit the forgot password email and the email is sent you can still log on with your old password but when I use the same line in my endpoint as above it somehow automatically resets the password and I can't authenticate the user with these apis. var validUser = Membership.Provider.ValidateUser(item.username, item.password); OR AuthenticationHelper.AuthenticateUser(item.username, item.password, SiteContext.CurrentSiteName);

Why does it reset the password ? Kind regards

Recent Answers


Swapna Narayandas answered on January 5, 2022 08:04 (last edited on January 5, 2022 08:11)

The purpose of the ForgottenEmailRequest is it tries to find user based on email address and if it finds the user, a password reset link is sent.

As per your post, the password is automatically getting reset, this will not happen by using the above line, it may happen only when you use any other auto reset functionality related methods in your code. Please check the code thoroughly and also the below api reference might help you understand the usage of the AuthenticationHelper class methods.

http://devnet.kentico.com/docs/11_0/api/html/T_CMS_Membership_AuthenticationHelper.htm

0 votesVote for this answer Mark as a Correct answer

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