How to read events for newly modified record from keycloak to spring boot

﹥>﹥吖頭↗ 提交于 2019-12-11 16:57:58

问题


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:

  1. you can implement some endpoint in your SpringBoot application that will be invoked by Even Listener's code
  2. or Event listener can send let's say JMS message and your SpringBoot application will be subscribed to the JMS topic
  3. etc.


来源:https://stackoverflow.com/questions/58843079/how-to-read-events-for-newly-modified-record-from-keycloak-to-spring-boot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!