assign_realm_role_to_user
Assign specific realm roles to a user in Keycloak by providing user ID, role names, and optional realm. Simplifies role management for identity and access control.
Instructions
Assign realm roles to a user.
Args:
user_id: User 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 |
---|---|---|---|
realm | No | ||
role_names | Yes | ||
user_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"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",
"role_names"
],
"title": "assign_realm_role_to_userArguments",
"type": "object"
}