Closed spinanicky closed 3 months ago
Is the user who is deleting the group a member of a different realm than where the group is? I.e. the master admin is deleting a group in the X realm?
If so, I think I see how it fails to lookup the user.
Correct
Got it. So that line is failing because it assumes the authenticated user is in the same realm as the action of the event, which it may not be in case of the master
realm. I think the fix logic should be something like:
user = getUserById(actionRealm, userId)
if user is null
user = getUserById(masterRealm, userId)
I don't believe there's a case where the fallback could be anything but the master
realm
@rtufisi can you take a look at this when you have time?
@rtufisi can you take a look at this when you have time?
Sure
Fixed in #68
With Keycloak 25.0.2, the following error occurs. When trying to use the webhook and deleting a group, keycloak fails to send the event.
I am using the latest V.30 tag (using clean build).
docker compose up with a keycloak-events build within a custom image (only has events jar and a theme added):
Create a new realm in admin console.
In the created realm:
This does not happen on the master realm in my testing, only in a new realm
Thank you to @xgp for pointing out where int he code it is failing: https://github.com/p2-inc/keycloak-events/blob/main/src/main/java/io/phasetwo/keycloak/events/WebhookSenderEventListenerProvider.java#L166
Let me know if you need additional information.