Remove roles from a user to ensure that they no longer have permissions to access the system.

To remove roles from a user:
  1. Log in to the Authorization server as an admin user. For more information, see Log in to Authorization server.
  2. Locate the Assign or remove roles API with endpoint PUT-/authz/api/users and expand it.
  3. To enable the text area, click Try it out to enable the text area.
  4. In the Parameters section, select removeRoles for the action parameter.
  5. In Request body, provide user details and roles in JSON format.
    {
        "userName": "string",
        "rolesToRemove": [
            "string"
        ]
    }
    The following table describes the attributes in the request body:
    Attribute name Description
    userName Specifies the user whose roles need to be removed.
    roleURN Identifies the role that needs to be removed from the user.

    For more information about roleURN, see Roles in Authorization server.

  6. Click Execute. If the removal of roles is successful, you see the response body in this format:
    {
     "message": "Request successful. These roles are removed for the user "userName": "roleURN""
    }

Example

The following example demonstrates the request and response bodies for removing the AUTHZ_ADMIN role for the user named, JessicaWilson.

Request body

Following are the contents of the request body in JSON format:

{
    "userName": "JessicaWilson",
    "rolesToRemove": [
        "role:authz/authz_admin"
    ]
}

Response body

Following are the contents of the response body in JSON format:
{
 "message": "Request successful. These roles are removed for the user "JessicaWilson": "role:authz/authz_admin""
 }