Remove Group From Role
Remove a user group membership from a role definition in RSA Governance & Lifecycle.
POST https://instance.securid.com/aveksa/command.submit?cmd=removeGroupFromRole
Purpose
The removeGroupFromRole command removes a specified User Group ID from a specified Role ID. This command requires an HTTP POST request where parameters are supplied as URL query parameters rather than in the request body.
Request
Parameters
| Parameter | Type | Requirement | Description |
|---|---|---|---|
cmd | string | Command name: removeGroupFromRole. | |
groupId | integer | The ID of the user group to remove from the role. | |
roleId | integer | The ID of the role from which the group will be removed. | |
format | string | Optional | The response format:properties: (Default) Key-value format (key=value). If multiple objects return, values are comma-separated.json: JavaScript Object Notation format. Suitable for programmatic parsing. |
token | string | Deprecated | Session token retrieved from loginUser. Deprecated. Use the Authorization request header instead. |
Request Headers
| Header | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Bearer token for a user with system administrator privileges, obtained via loginUser. Format: Bearer <token>. | |
Accept | string | Optional | Desired response MIME type (for example, application/json or text/plain). |
Content-Type | string | Optional | Content type header: application/x-www-form-urlencoded or application/json. |
The Authorization request header replaces the deprecated token URL query parameter.
Role management commands currently require an authenticated user session token obtained via loginUser with the Role Administrator capability. While the Web Services Administration console allows mapping Role commands to a Trusted Application, requests using a Trusted Application token (loginTrustedApp) currently return HTTP 403 (Couldn't perform edit action on role).
Response
Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Execution result: success or failure. |
message | string | Optional diagnostic or status message returned by the server. |
Examples
Request
- Curl
- Python
- Node.js
- PowerShell
curl -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=removeGroupFromRole&groupId=2&roleId=3&format=json" \
-H "Authorization: Bearer <user-token>" \
-H "Accept: application/json"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "removeGroupFromRole",
"groupId": 2,
"roleId": 3,
"format": "json"
}
headers = {
"Authorization": "Bearer <user-token>",
"Accept": "application/json"
}
response = requests.post(url, params=params, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f"Request failed: {response.status_code} - {response.text}")
const axios = require('axios');
const url = "https://instance.securid.com/aveksa/command.submit";
const params = {
cmd: 'removeGroupFromRole',
groupId: 2,
roleId: 3,
format: 'json'
};
const headers = {
Authorization: 'Bearer <user-token>',
Accept: 'application/json'
};
axios.post(url, null, { params, headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Request failed:', error.response ? error.response.data : error.message);
});
$uri = "https://instance.securid.com/aveksa/command.submit?cmd=removeGroupFromRole&groupId=2&roleId=3&format=json"
$headers = @{
"Authorization" = "Bearer <user-token>"
"Accept" = "application/json"
}
$response = Invoke-RestMethod -Uri $uri -Method Post -Headers $headers
$response
Response
- 200 (JSON)
- 200 (Properties)
- 401 No Token
- 401 Invalid Token
- 403 Authorization Limitation
- 404 Not Found
- 412 Missing Parameter
{
"status": "success",
"message": "Group 2 successfully removed from role 3."
}
status=success
message=Group 2 successfully removed from role 3.
<html>
<head>
<title>Error</title>
</head>
<body>The token is required for the command 'removeGroupFromRole'</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The token is not valid for the command 'removeGroupFromRole'. Token is invalid or expired</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>Couldn't perform edit action on role. Check user authorization or roleset permissions.
Query String=cmd=removeGroupFromRole&groupId=2&roleId=3&format=json</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The role with ID 3 could not be found.
Query String=cmd=removeGroupFromRole&format=json&groupId=2&roleId=3</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The parameter groupId is required and should be a number.
Query String=cmd=removeGroupFromRole&format=json&roleId=3</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.
References
- Add Group To Role: Add a user group to a role
- Commit Role: Commit pending changes to a role after removing groups
- RFC 6750: OAuth 2.0 Bearer Token Usage
- RFC 7235: Hypertext Transfer Protocol (HTTP/1.1) Authentication