0

我已将所有用户更新为 email_verified = true。PSQL 数据库得到更新,但管理控制台继续让用户没有验证他们的电子邮件。我正在通过 Rancher 上的 CLI 进行更改。

我正在使用的命令是:

UPDATE user_entity SET email_verified = true WHERE email_verified = false

我在这里能看到的唯一帮助是来自KeyCloak 中用户的批量更新

批量更新用户是否更复杂?有没有其他方法可以批量更新用户?

4

1 回答 1

0

My guess is that the old data is still around in Keycloak's cache. Some options are:

  1. Restart Keycloak
  2. Clear the cache
  3. Turn off caching permanently

For #2, you can clear the user or realm caches at runtime on the "Realm Settings -> Cache" section of the keycloak admin page:

enter image description here

For #3, you can read the below source for instructions: https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.0/html/server_installation_and_configuration_guide/server_cache_configuration

8.3. Disabling Caching

To disable the realm or user cache, you must edit the keycloak-server.json file in your distribution. Where this file lives depends on your operating mode Here’s what the config looks like initially.

"userCache": {
    "default" : {
        "enabled": true
    }
},

"realmCache": {
    "default" : {
        "enabled": true
    }
},

To disable the cache set the enabled field to false for the cache you want to disable. You must reboot your server for this change to take effect.

8.4. Clearing Caches at Runtime

To clear the realm or user cache, go to the Red Hat Single Sign-On admin console Realm Settings→Cache Config page. On this page you can clear the realm cache or the user cache. This will clear the caches for all realms and not only the selected realm.

于 2022-02-23T20:31:20.363 回答