Keycloak re-check with a non-groups claim (roles): a refused sign-in cannot pause app passwords #1001

Closed
opened 2026-10-25 19:20:05 +00:00 by Cordy · 2 comments
Owner

Found in the batch-6 final review (S2, .superpowers/sdd/2026-10-25-batch6/final-review.md). Decision (Nikola, 2026-10-25): ship v0.6.354 with this documented and fix it here.

Gap. With the Keycloak admin client and oidcGroupsClaim other than groups (for example roles), the device-pause store is never created. A refused sign-in ends the sessions but pauses nothing, so the person's app passwords keep working until an admin revokes them. Turning pauses on is not enough, because the Keycloak re-check (which checks groups) would lift them again right away.

v0.6.354 behaviour. The start WARN says "... and a refused sign-in pauses no app password: revoke them by hand". This is documented in the CHANGELOG and in the Entra, users-access and deployment docs.

Fix direction (to research and design). The re-check must not lift a pause set by a role-based refusal. Options:

  • read the role mappings through the admin client in the re-check;
  • or keep role-based pauses until the next accepted sign-in.
Found in the batch-6 final review (S2, `.superpowers/sdd/2026-10-25-batch6/final-review.md`). Decision (Nikola, 2026-10-25): ship v0.6.354 with this documented and fix it here. **Gap.** With the Keycloak admin client and `oidcGroupsClaim` other than `groups` (for example `roles`), the device-pause store is never created. A refused sign-in ends the sessions but pauses nothing, so the person's app passwords keep working until an admin revokes them. Turning pauses on is not enough, because the Keycloak re-check (which checks groups) would lift them again right away. **v0.6.354 behaviour.** The start WARN says "... and a refused sign-in pauses no app password: revoke them by hand". This is documented in the CHANGELOG and in the Entra, users-access and deployment docs. **Fix direction (to research and design).** The re-check must not lift a pause set by a role-based refusal. Options: - read the role mappings through the admin client in the re-check; - or keep role-based pauses until the next accepted sign-in.
Author
Owner

Research and decision (2026-10-28)

Research: research-identity-996-1001-1034.md. Reading role mappings through the admin client (/role-mappings/realm/composite etc.) can't tell which Keycloak mapper produced the ID-token claim (realm vs client roles, prefix, role scope), so it could lift or set pauses wrongly.

Decision (Nikola): pause until the next accepted sign-in, the rule Entra already uses. With the admin client and a claim other than groups, a refused sign-in pauses the person's app passwords; the 5-minute re-check, appValid and the daily sweep can't lift such a pause (marker in the shared pause file, #742); only an accepted sign-in or an admin does. Not purged after 30 days (same as Entra). The start WARN and the four doc places change accordingly.

## Research and decision (2026-10-28) Research: research-identity-996-1001-1034.md. Reading role mappings through the admin client (`/role-mappings/realm/composite` etc.) can't tell which Keycloak mapper produced the ID-token claim (realm vs client roles, prefix, role scope), so it could lift or set pauses wrongly. Decision (Nikola): **pause until the next accepted sign-in**, the rule Entra already uses. With the admin client and a claim other than `groups`, a refused sign-in pauses the person's app passwords; the 5-minute re-check, `appValid` and the daily sweep can't lift such a pause (marker in the shared pause file, #742); only an accepted sign-in or an admin does. Not purged after 30 days (same as Entra). The start WARN and the four doc places change accordingly.
Author
Owner

Shipped in v0.6.367 (PR #1037), both dogfoods bumped.

With the Keycloak admin client and a claim other than groups, a refused sign-in now pauses the person's app passwords until their next accepted sign-in (until: "sign-in" in device-pauses.json). The re-check, appValid, the daily sweep and the purge can't lift it; the decision is made on the shared file (#742). New start WARN text; docs updated (Entra, deployment, users-access).

Behaviour notes: such refusals now count toward the #1003 safety stop; the daily OIDC device sweep runs in this setup too. Live check in #1005 (P), only if a dogfood uses such a claim.

Shipped in v0.6.367 (PR #1037), both dogfoods bumped. With the Keycloak admin client and a claim other than `groups`, a refused sign-in now pauses the person's app passwords until their next accepted sign-in (`until: "sign-in"` in device-pauses.json). The re-check, `appValid`, the daily sweep and the purge can't lift it; the decision is made on the shared file (#742). New start WARN text; docs updated (Entra, deployment, users-access). Behaviour notes: such refusals now count toward the #1003 safety stop; the daily OIDC device sweep runs in this setup too. Live check in #1005 (P), only if a dogfood uses such a claim.
Cordy closed this issue 2026-10-28 12:43:30 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1001
No description provided.