Repository navigation
How can I capture an authorization change as a portable event in Keycloak? #53223
Replies: 1 comment
|
Hi Massimo, you can do this with built-in Keycloak features. A small setup with one client, Authorization enabled, one resource and one policy is enough. 0. Turn on events Realm settings → Events:
1. BEFORE Export the authorization settings of the client: 2. CHANGE Change the policy (Admin Console or Admin REST API). Keycloak stores an admin event with 3. AFTER Call the same 4. EVIDENCE (the decision) Ask Keycloak for a decision as a test user, before and after the change: You get So for one change you have: BEFORE (export) → CHANGE (admin event) → AFTER (export) → EVIDENCE (decision + user event), all linked by time and resource. If you want to send this to an external system instead of polling, write an Event Listener SPI provider. It receives both user events and admin events ( The Authorization → Evaluate tab in the client is also handy to test decisions, but its results are not stored as events. |
Uh oh!
There w 8000 as an error while loading. Please reload this page.
Hello Keycloak community,
I’m validating a vendor-neutral approach for representing an authorization change as:
BEFORE → authorization state
CHANGE → authorization modification
AFTER → resulting authorization state
EVIDENCE → decision/audit evidence
I’m looking for one small, controlled, non-production example using Keycloak.
For example, a simple authorization or access-control policy change where we can observe the authorization state before and after the modification, trigger an authorization decision, and identify the corresponding audit or decision evidence.
No production access, credentials, or customer data are required.
The goal is to validate whether this transition can be represented as a portable authorization-change event.
What would be the recommended way to capture the BEFORE/CHANGE/AFTER state together with the corresponding authorization decision and audit evidence in Keycloak?
Thank you,
Massimo
All reactions