set_user_enabled
Enable or disable a Keycloak user account to block authentication for compromised or decommissioned users, while preserving custom attributes.
Instructions
Enable or disable a user account.
Disabling blocks all authentication (SSO logins) for the user — the
containment action for a compromised or decommissioned account. Only the
enabled flag is changed; custom attributes are preserved.
Disabling does not terminate existing sessions (an already-issued token
stays valid until it expires), so when disabling this reports how many
sessions remain and to run logout_user to end them immediately.
Args: username: Exact username (email). enabled: True to enable, False to disable.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"username": "<username>",
"enabled": "<enabled>"
},
"name": "set_user_enabled"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | ||
| username | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |