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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | ||
| username | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |