Bulk update of users in KeyCloak

陌路散爱 提交于 2020-05-15 03:35:32

问题


I have a task to change the status of users in the IDM. The solution I chose is naive: looping each one and calling KeyCloak's service using REST.

However, I've noticed that this consumes a lot of time. I thought that something like bulk update (equivalent to SQL) might solve the issue, but I didn't find it in KeyCloak's API.

Does anyone know how to fix it? Thanks for help!


回答1:


Do you have access to Keycloak's database? If that's the case, you may update users' data with SQL sentences. The schema is pretty straightforward to understand, I've made bulk updates in this fashion before.

What do you mean by "status"? If you mean the "enabled" status, your update will look like this:

UPDATE user_entity SET enabled = (value) WHERE (your conditions)

AFAIK, there's no way to bulk update through REST or the admin console.

Good luck!



来源:https://stackoverflow.com/questions/34840830/bulk-update-of-users-in-keycloak

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