Plugin | min Keycloak ver |
---|---|
0.x | 19.x |
For example here is the notification of the user updated by administrator
- published to queue name :
KC.EVENT.ADMIN.MYREALM.USER
- content:
{
"@class" : "org.niannarilli.keycloak.events.model.EventAdminNotificationMqMsg",
"time" : 1674124056092,
"realmId" : "MYREALM",
"authDetails" : {
"realmId" : "master",
"clientId" : "********-****-****-****-**********",
"userId" : "********-****-****-****-**********",
"ipAddress" : "192.168.1.1"
},
"resourceType" : "USER",
"operationType" : "UPDATE",
"resourcePath" : "users/********-****-****-****-**********",
"representation" : "representation details here....",
}
The queue name is calculated as follows:
- admin events:
KC.EVENT.ADMIN.<REALM>.<RESOURCE>
- client events:
KC.EVENT.CLIENT.<REALM>.<CLIENT>
- Download the latest jar or build from source:
mvn clean install
- Copy jar into your Keycloak version 19+ (Quarkus)
/opt/keycloak/providers/keycloak-to-activemq-0.1.0.jar
- Configure as described below
- Restart the Keycloak server
- Enable logging in Keycloak UI by adding keycloak-to-activemq
Manage > Events > Config > Events Config > Event Listeners
KC_TO_AMQ_URL
- default: localhostKC_TO_AMQ_PORT
- default: 61616KC_TO_AMQ_USERNAME
- default: adminKC_TO_AMQ_PASSWORD
- default: adminKC_TO_AMQ_FILTER_SUCCESS
- default: trueKC_TO_AMQ_FILTER_CLIENT
- default: *KC_TO_AMQ_FILTER_RESOURCE
- default: *