Changing a user password

You can change the password of an individual user. To modify other settings of users, see Modifying settings of users.

Tip

Passwords of users in an LDAP group are usually managed by the LDAP server.

Method and URI

To change the password, use a POST method and a URI:

POST    https://{hostname|IP}/api/security/user/{userId}

This POST request is idempotent.

Tip

To get a {userId} value based on the user name, follow the instructions in Getting a {userId}.

Parameters

Parameter 1: action

Start an action to change the user password.

  • Value: changePassword

  • Type: System string. Required. Available in the web user interface.

Data

Data 1: newPassword

A new password.

  • Example value: LGe;9BQd%L<4]cF-

  • String. Requried. Available in the web user interface.

Example: Update the password of an individual user

Assume that you want to change the password of the user Sarah (userId: 1005) from MyPassw0rd! to LGe;9BQd%L<4]cF-. A Python snippet that is similar to the following example can be used to send a request to IBM Spectrum Protect Plus to update the password:

user_id = "1005"

_params = {"action": "changePassword"}

_data = f'''{{
    "newPassword": "LGe;9BQd%L<4]cF-"
}}'''

requests.put('https://' + spp_ipv4 + '/api/security/user/' + user_id,
    headers={...}, params=_params, data=_data, verify=...)

After you run the Python snippet, ensure that you get a response with the HTTP status of 204 (No Content) and that the user password is updated. There is no response body. Because this request is idempotent, you may send the same request and receive the same response without making any changes.