Assign Roles to User REST Service

Use the Assign Roles to User REST Service to assign multiple roles to a user.

Operation
POST
URL
https://host:port/SKLM/rest/v1/ckms/usermanagement​/users​/{userName}​/roles

By default, Guardium® Key Lifecycle Manager server listens to the secure port 9443 (HTTPS) for communication. During IBM® Security Guardium Key Lifecycle Manager installation, you can modify this default port.

Request

Request Parameters
Parameter Description
host Specify the IP address or hostname of the IBM Security Guardium Key Lifecycle Manager server.
port Specify the port number on which the IBM Security Guardium Key Lifecycle Manager server listens for requests.
Request Headers
Header name Value
Content-Type application/json
Accept application/json
Authorization SKLMAuth userAuthId=<authIdValue>
Accept-Language Any valid locale that is supported by IBM Security Guardium Key Lifecycle Manager. For example, en or de.
Query Parameter

JSON object with the following specification.

JSON property name Description
userName Required. Specify the name of the user to which you want to assign the roles.
Request Body

JSON object with the following specification.

JSON property name Description
roleNames Required. Specify a JSON array of role names that you want to assign to the user.

Response

Response Headers
Header name Value and description
Status Code
200 OK
The request was successful. The response body contains the requested representation.
400 Bad Request
The authentication information was not provided in the correct format.
401 Unauthorized
The authentication credentials were missing or incorrect.
404 Not Found Error
The processing of the request fails.
500 Internal Server Error
The processing of the request fails because of an unexpected condition on the server.
Content-Type application/json
Content-Language Locale for the response message.
Success Response Body

JSON object with the following specification.

JSON property name Description
code Returns the code that is specified by the status property.
status Returns the status to indicate if the operation was successful.
Error Response Body

JSON object with the following specification.

JSON property name Description
code Returns the application error code.
message Returns a message that describes the error.

Examples

Assign roles to a user
POST 
https://host:port/SKLM/rest/v1/ckms/usermanagement​/users​/DS5000user​/roles
{"roleNames":"DS5000_Custom","DS8000_Custom"}
Success response
{
  "code": "0",
  "status": "Succeeded"
}
Error response
{
  "code": "CTGKM3040E",
  "message": "CTGKM3040E Object with identifier DS5000user cannot be found."
}