Keycloak: 通过API收到新用户注册通知

huangapple go评论68阅读模式
英文:

Keycloak : Get notified via API when a new user registers

问题

我有一个Angular(客户端)Java Spring Boot 2(服务器端)应用程序,该应用程序重定向到Keycloak,以便用户进行身份验证/注册等操作。用户登录后,会带着他们的令牌重定向回应用程序。

我想要在Java服务器端知道用户注册的时间,以便我可以在我的数据库中为他们创建一些额外的内容。是否有一种标准的方法可以“监听”用户在我的Keycloak上注册的事件?有关于这种行为的Java示例吗?

提前谢谢。

英文:

I have an Angular (client-side) Java Spring Boot 2 (server-side) application that redirects to Keycloak in order for the user to perform their authentication / registration etc. And after the users logs in, they are redirected to the application with their token.

I want to know (on the Java server-side) when a user registers, so that I can create some extra things in my own database for them. Is there a standard way to "listen" to when a user registers on my Keycloak? Any example for such behavior in Java?

Thank you in advance.

答案1

得分: 3

Keycloak为您提供了实现EventListenerSPI的选项,但我不确定是否有适用于完成注册的事件类型,因此最好您实现自定义注册步骤。实现后,您可以将其放置在注册流程的末尾(管理控制台中的身份验证设置部分),并在外部数据库中执行您的任务。

英文:

Keycloak provide for you option to implement EventListenerSPI, but i'm not sure that there is an appropriate event type for finished registration, so it would be better for you to implement custom registration step. After implementation you could put it to the end of registration flow (Authentication settings section in admin console) and perform your tasks in external DB.

huangapple
  • 本文由 发表于 2020年9月2日 22:34:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/63707827.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定