Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Password Reset Form Fails

Avatar

Level 4

I've built a password reset form for my users using an Adaptive Form. I have AJAX calling a Sling Servlet to update the password, and everything works correctly on my local AEM instance. I've built the servlet based on the OOTB password reset logic JSP from /libs/foundation/components/account/passwordreset.

On my local instance, the password is reset after meeting all of the requirements with a matching current password. On my dev AWS instance, which I know is set up differently and is managed by another department, the password reset fails every time with the message "Failed to change password: Old password does not match." returned from a try catch on the changePassword() call. This is happening regardless of the correctness of the current password.

I have a different form that I build using the OOTB password reset form from the old Forms component. This is using the JSP from /libs/foundation/components/account/passwordreset and successfully updates the password with the Adaptive Form version will not work. Once I've updated the password with the OOTB form, my Adaptive Form version will work correctly for a limited period of time.

What am I missing in my form? Some kind of token or authorization? Is this a hidden field I can create?

1 Accepted Solution

Avatar

Correct answer by
Level 4

On our dev instance, the processing script was always seeing the user as admin. Made some modifications to pass the username through in a hidden field, and everything is working.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

On our dev instance, the processing script was always seeing the user as admin. Made some modifications to pass the username through in a hidden field, and everything is working.