Keycloak shows how to automate account onboarding and expire temporary admin access
The upstream guide demonstrates three event-driven workflows and explains why shortening their delays is not enough to test them quickly.
The Keycloak project’s Nov. 27 engineering guide shows how realm administrators can turn three recurring identity tasks into rules: provision access for new engineers, warn inactive users before disabling their accounts, and revoke temporary admin access on a schedule. This is a walkthrough for upstream Keycloak, not a product release or an announcement of support in the Red Hat build.
What the workflows do
Each YAML definition starts with an event, can filter the affected resource with a condition, and runs a sequence of actions. The Keycloak Server Administration Guide explains that matching events create an execution bound to the affected realm resource, with steps running immediately or on a delay.
In the onboarding example, a user creation event triggers the rule only if the user’s department is set to engineering. The workflow sends a welcome email, grants the developer role and adds the user to the engineering group.
The inactivity example starts on authentication. It sends a reminder after 90 days, waits another 60 days before issuing a final warning, then waits seven more days before disabling the account. A fresh login restarts an in-progress workflow, so the example tracks inactivity rather than the age of the account.
The temporary-access example starts when the specific admin role is granted. It warns the user after seven days and revokes the role one day later, unless the account is marked as a permanent administrator under the example’s policy. Those intervals are choices made in the guide, not defaults.
What to test before rollout
Use a test realm and verify both sides of each rule: a user who should qualify and one who should not. For inactivity, check that a fresh login actually resets the waiting period. For temporary access, verify that the role is removed on schedule and that the intended permanent administrators are excluded.
The guide notes two practical prerequisites: notification steps need a working SMTP configuration, and shortening a delay in YAML does not speed up the background job that looks for due steps. That job checks every 12 hours by default, according to the guide. For a quick test, shorten both the step delays and the polling interval in the development environment; restore the intended policy timings before rollout.
sources
comments · 0