如何从keycloak到spring boot读取新修改记录的事件 [英] How to read events for newly modified record from keycloak to spring boot
问题描述
实际上,我们有以下流程和方案可将数据轮询到我的Spring Boot应用程序中
Actually We have following flow and scenario to poll data in to my Spring boot App
Active Directory-> Keycloak-> Spring boot App
Active Directory --> Keycloak --> Spring boot App
这里我们可以轮询数据,但是将来如果Active Directory密钥库中有任何记录更改,则可以定期轮询其数据库中的数据,但是密钥库中的记录更改(新添加/已删除/已更新)的记录到Spring Boot应用程序有一些事件选项,但我看不到如何以及在哪里实现? 我想在Spring Boot应用程序中应该有一个侦听器,该侦听器会在keycloak的记录(新添加的/删除的/更新的)中发生任何更改时触发
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
推荐答案
事件侦听器在Keycloak端实现.这是一个如何实现将事件记录到控制台的事件侦听器的示例-
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
您需要以任何合适的方式将通知发送到SpringBoot应用程序,而不是进行日志记录:
Instead of logging, you will need to send notifications to your SpringBoot application in any suitable way:
- 您可以在SpringBoot应用程序中实现一些端点,该端点将由Even Listener的代码调用
- 或者事件监听器可以发送JMS消息,您的SpringBoot应用程序将被订阅到JMS主题
- 等
这篇关于如何从keycloak到spring boot读取新修改记录的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!