简体   繁体   English

在 Keycloak Spring boot 中从另一个领域获取用户列表

[英]Get list of users from another realm in Keycloak Spring boot

I have two realms in Keycloak "internal" and "external".我在 Keycloak“内部”和“外部”中有两个领域。

As a user (not Admin!) from "internal" realm I would like to get list of users from "external" realm.作为“内部”领域的用户(不是管理员!),我想从“外部”领域获取用户列表。

There is default Role "view_users" but I guess it's only for the users from the same realm right ?有默认角色“view_users”,但我想它只适用于来自同一领域的用户,对吧?

is it possible as not admin user to access to another realm ?不是管理员用户可以访问另一个领域吗?

how it would look like in java Spring Boot ?在 java Spring Boot 中它会是什么样子?

This is not possible in Keycloak by design, realms are isolated from each other.这在 Keycloak 设计中是不可能的,领域是相互隔离的。 The exception to this rule is the master realm.此规则的例外是主域。 A user that is in the master and has the global admin role is allowed to do everything in all realms.主用户且具有全局admin角色的用户可以在所有领域中执行所有操作。

In addition, there are (automatically generated) management clients for all realms in the master realm, in your case named internal-realm and external-realm .此外,主领域中的所有领域都有(自动生成的)管理客户端,在您的情况下名为internal-realmexternal-realm These clients, in turn, have a list of client-roles that allow the user that is in those roles, to perform specific actions.反过来,这些客户端具有允许处于这些角色中的用户执行特定操作的客户端角色列表。 You can read more about this in the Keycloak documentation here .您可以在此处的 Keycloak 文档中阅读更多相关信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM