Question
Accenture
AU
Last activity: 12 Mar 2025 14:53 EDT
Operator ID password update not working
My requirement is to update the password for an admin operator in Pega using an API. For eg [email protected]. In my custom activity, I am setting the new password to pyPwdnew and after that validating it using pzValidateOperatorPassword Activity which will set the new password to current password in the last step (pyPwdCurrent =pyPwdNew)
After this, I am doing an Open-save and Commit. When I test the API, it has successfully updated the password, but when I try to login to the environment using the new password which I updated using API, it is throwing Invalid user id/password.
I even tested the API again by providing a different current password and it errored out " current password does not match" which means the new password is updated for the Operator record.
Not sure why it is not accepting the new password for login. Appreciate your thoughts and suggestions.
Also is there any way where we can programmatically use the username and password to login to the environment once we update the password in the custom activity?
Appreciate your suggestions.
@RajeshChandarS as you have not had any response, I will provide some input.
NOTE: The below answer came from a GenAI tool. It is imperative you check the References used to come with this answer.
There are several potential reasons why the password update would succeed in the operator record but fail during login authentication.
@RajeshChandarS as you have not had any response, I will provide some input.
NOTE: The below answer came from a GenAI tool. It is imperative you check the References used to come with this answer.
There are several potential reasons why the password update would succeed in the operator record but fail during login authentication.
Possible Causes for the Login Failure
The new password may not meet all security requirements set in your Pega environment, even though it's being accepted by the API. When updating passwords programmatically, the API might update the record but the authentication service may enforce additional validation rules during login attempts.
Check if the "Force password change on next login" flag is getting set to true during your update process. This setting would prevent direct login with the new password, as the system would require an additional password change.
Some authentication systems cache credentials. Your password might be updated in the operator record, but the authentication service could still be using cached values.
The password in the operator record is stored as a hashed value. There might be an issue with how the hashing is performed through your API compared to the standard password update process.
The standard password change process may include additional steps beyond just updating the pyPassword property, such as updating security tokens or timestamps.
Suggested Fixes
.pyMustChangePassword = falseobj.save();tools.commitClipboardPages();Programmatic Login After Password Update
For programmatically logging in after a password update, I recommend using OAuth 2.0, which is the preferred authentication approach for Pega APIs:
/prweb/api/v1/authenticateendpointPOST /prweb/api/v1/authenticate HTTP/1.1Host: your-pega-instance.comContent-Type: application/json{"grant_type": "password","client_id": "your_client_id","client_secret": "your_client_secret","username": "[email protected]","password": "pyPwdnew"}GET /prweb/api/v1/data/... HTTP/1.1Host: your-pega-instance.comAuthorization: Bearer your_access_tokenIf you're working within the same activity that updates the password, consider implementing a brief delay between the password update and login attempt to allow any backend synchronization to complete.
References:
Users cannot log in
Authentication and authorization
Defining security information for the operator
Authentication login failures