I have a scenario that I am running through that I could use some help understanding better. This is using Keycloak v15.0.2
I have an event listener setup to listen to Keycloak events surrounding groups. Basically anytime a group is created/updated/deleted, or a user is added or removed from a group, I take that event and publish a rabbit message using those event details. While setting these up, I see a difference between how Keycloak handles groups vs how it handles the events for these groups.
An example: I have a parent group with 2 sub-groups (see screenshot from admin console). From the setup so far, I would have 3 rabbit messages/events indicating 3 groups that have been created. If I delete the parent group, I would expect that either:
A) the delete event includes a list of the sub group IDs that I can use, OR
B) Keycloak will generate multiple delete events for each individual group that will be deleted.
Instead I am provided with one delete event that only provides the deleted group’s ID and nothing else to go off of (see screenshot of event object). So now according to Keycloak there are no existing groups, and according to the rabbit messages/Keycloak events generated I have two active subgroups with a parent group that is deleted.
I could also see a similar issue occurring if a user is added to an existing sub-group; the event will only provide the sub group ID, and while the path value will show that it has a parent group “/parentgroupname/subgroupname”, I cannot use only the parent group name to pull up the other relevant group info such as the parent group ID from that alone.
All this being said: am I missing anything with regard to obtaining a deleted groups child group IDs within the event listener, and if not, is there a way for me to extend the current logic that builds the group AdminEvent such that I can add the sub group information into the delete event?
Any help is appreciated and if I can provide any additional information please let me know. Thank you!