AdminEvent of resource type AUTHORIZATION_POLICY operation type CREATE doesn’t seem to get created.
#20,008 opened on 2023/04/27
Repository metrics
- Stars
- (34,398 個のスター)
- PR merge metrics
- (平均マージ 6d 19h) (30d で 384 merged PRs)
説明
Before reporting an issue
- I have searched existing issues
- I have reproduced the issue with the latest release
Area
admin/api
Describe the bug
Hi there,
I am writing a custom event listener to send out emails when an authorization policy is created, but I don’t think an admin event gets fired when such events occurred. To prove that was the case I had added logging first thing in the event listener to log every admin event coming through. Looking at the Admin Events log table in the admin console, I also only see operation type UPDATE or DELETE for AUTHORIZATION_POLICY. I looked at keycloak’s source code briefly, isn’t this line supposed to send the CREATE of AUTHORIZATION_POLICY to the event store and also all the listeners? For the context, we are running Keycloak 21.1.0 in a container and calling the protection endpoint directly. (POST /auth/realms/{realm}/authz/protection/uma-policy?name={policy_name}).
Version
21.1.0
Expected behavior
An event listener should be able to listen to the admin event of resource type AUTHORIZATION_POLICY and operation type CREATE.
Actual behavior
There is no admin event fired when an authorization policy is created via the API.
How to Reproduce?
- Turn on Admin Events.
- Call POST /auth/realms/{realm}/authz/protection/uma-policy?name={policy_name}
- No event gets logged in the Admin Events table in the admin console.
Anything else?
No response