Editing an identity¶
You can edit an identity.
Method and URI¶
To update the identity with {identityUserId}
, use a PUT method and a URI:
PUT https://{hostname|IPv4}/api/identity/{identityUserId}
Parameters¶
None.
Data¶
You can use the data key-value pairs that were described in Adding an identity.
Example: Update an identity defined by Microsoft Active Directory¶
Sarah has created an identity based on her own Microsoft Active Directory (AD) credential. Now she wants to use a shared account of the IT team instead:
Name: BlueMachines-AD
Username:
AD-BlueMachines\Administrator
Password:
=q<gEbbN5G6$6xAh
Comment: An Active Directory shared credential
A Python snippet that is similar to the following example can be used to update the identity settings. As you see in the password value, \\
represents the backslash in Python’s f-string and \\
represents a backslash.
identity_user_id = "2101"
_data = f'''{{
"name": "BlueMachines-AD",
"username": "AD-BlueMachines\\\\Administrator",
"password": "=q<gEbbN5G6$6xAh",
"comment": "An Active Directory shared credential"
}}'''
requests.put('https://' + spp_ipv4 + '/api/identity/user/' + identity_user_id,
headers={...}, data=_data, verify=...)
The request prompts a response that is structured as shown, with the HTTP status of 201 (Created). Ensure the new identity AD-sarah.wiseman has been updated. The password value is represented by null
.
{
"links": {...},
"resourceType": "user",
"id": "2101",
"name": "BlueMachines-AD",
"username": "AD-BlueMachines\\Administrator",
"type": "system",
"ostype": null,
"comment": "An Active Directory shared credential",
"keyid": null,
"realm": "\\ADMINISTRATOR",
"rbacPath": "root:0/identity:0/identitytype:credential/identitycredential:21
↪34",
"password": null
}