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?