assign_client_role_to_user
Assign specific client roles to a user in Keycloak by providing user ID, client ID, and role names. Optionally specify a target realm for role assignment.
Instructions
Assign client roles to a user.
Args:
user_id: User ID
client_id: Client database ID
role_names: List of role names to assign
realm: Target realm (uses default if not specified)
Returns:
Status message
Input Schema
Name | Required | Description | Default |
---|---|---|---|
client_id | Yes | ||
realm | No | ||
role_names | Yes | ||
user_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"client_id": {
"title": "Client Id",
"type": "string"
},
"realm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Realm"
},
"role_names": {
"items": {
"type": "string"
},
"title": "Role Names",
"type": "array"
},
"user_id": {
"title": "User Id",
"type": "string"
}
},
"required": [
"user_id",
"client_id",
"role_names"
],
"title": "assign_client_role_to_userArguments",
"type": "object"
}