在KeyCloak中批量更新用户 [英] Bulk update of users in KeyCloak

查看:528
本文介绍了在KeyCloak中批量更新用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任务来更改IDM中用户的状态.我选择的解决方案很幼稚:循环每个循环并使用REST调用KeyCloak的服务.

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.

但是,我注意到这会花费很多时间.我认为诸如批量更新(相当于SQL)之类的东西可能可以解决此问题,但我在KeyCloak的API中找不到它.

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!

推荐答案

您可以访问Keycloak的数据库吗?在这种情况下,您可以使用SQL语句更新用户的数据.该模式非常容易理解,我之前已经以这种方式进行了批量更新.

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,无法通过REST或管理控制台进行批量更新.

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

祝你好运!

这篇关于在KeyCloak中批量更新用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆