-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to attach more data on registration/update event? #14
Comments
🤔 Sure. But it's an event. It'll mean fetching those data directly in the keycloak and potentially increasing the payload. The part in the code responsible of it is here. What other data would be need in that case? |
Thanks for writing back @stephane-segning
So, it seems that you can not do that inside the
If the above means what I think it means, then attaching data to the event will definitely be useful if your synchronization user flows depends on some user attribute or some role that is assigned during registration and I believe that it will be done more cleanly in the hook than waiting for the user to actually login to your system and then make the synchronization if you detect that you do not have the user data in your database yet.
The first thing I checked was if there was some kind of option to "attach token mapper to event" from the keycloak UI like you do with token mappers and "add to id token/add to access token/add to user info". That would definitely help controlling the payload size easier and it would be friendlier in general for more customization. I understand that this is not in the scope of this library I am just saying that it would have been nice :)
I guess that this depends. Personally (for my case at least) I find realm roles/client roles and user attributes useful to include and if you are worried about the payload they can only be included in the register event that happens once instead of including them in events that happen very often (e.g. token refresh). Also there are some other cases that I've noticed that you could have an extra field or two in the payload. For example, the Just throwing my thoughts out there :) |
I would also like to say here that if the above is indeed true, and the hooks are called synchronously, then it would be very helpful if For example, if a non I understand that this might not be the behavior everyone wants so an extra setting for the plugin might be helpful. |
@stephane-segning ,I've been playing around some more with the plugin and the
At first, I thought that the In the Keycloak UI, you can see the admin events like so: Notice in the screenshot above the In general, like I have mentioned in my previous posts in this issue, I think that a bit more data on which the receiving end can act upon, could be added to the event payload. Edit: Plenty of useful stuff in the admin event payload from what I see here. |
I did what you asked for here |
@valid-var cheers! I will give it a try very soon :) |
Hello,
So, I have been using the webhook to synchronize user registration data with my database and I was wondering if there is some way to include in the event object more data, like client roles, or user attributes.
I understand that I can fetch the extra data i need via keycloak REST API but if the event object can carry them it would definitely be helpful.
Thank you for your time.
The text was updated successfully, but these errors were encountered: