问题
Actually We have following flow and scenario to poll data in to my Spring boot App
Active Directory --> Keycloak --> Spring boot App
Here we are able to poll data in but in future if there is any record change in Active Directory keycloak has a provision to poll data in it's DB periodically but the same changed (Newly Added /Deleted /Updated ) records from key cloak to Spring boot application there is some eventing option but I do not see how and where to implement it ? I suppose there should be a listener in the spring boot application which would get triggered on any change in record (Newly Added /Deleted /Updated ) of keycloak
回答1:
The event listener is implemented on the Keycloak side. Here is an example of how to implement an event listener that logs events to console - Event Listener Example
Instead of logging, you will need to send notifications to your SpringBoot application in any suitable way:
- you can implement some endpoint in your SpringBoot application that will be invoked by Even Listener's code
- or Event listener can send let's say JMS message and your SpringBoot application will be subscribed to the JMS topic
- etc.
来源:https://stackoverflow.com/questions/58843079/how-to-read-events-for-newly-modified-record-from-keycloak-to-spring-boot