p2-inc / keycloak-events

Useful Keycloak event listener implementations and utilities.
https://phasetwo.io
Other
195 stars 36 forks source link

#66 Use the original admin event authentication context to get realm #68

Closed rtufisi closed 3 months ago

rtufisi commented 4 months ago

original extAuthDetails are null in ExtendedAdminEvent

logic here seems a bit wrong:

public ExtendedAdminEvent(String uid, AdminEvent event, RealmModel realm) {
 .....
    setAuthDetails(event.getAuthDetails());
    extAuthDetails.setRealmId(realm.getName());
....
}

we are basically overidding the realm of the original AuthDetails with the realm in which the event is triggered

rtufisi commented 4 months ago

@xgp please check the comment above. I'm not sure what functionalities are affected by that logic

xgp commented 3 months ago

@rtufisi I agree. We need to attempt to discover the auth realm, rather than use the event realm.