How to properly do delegated user self-administration with Keycloak

孤者浪人 提交于 2019-12-03 16:46:27

KeyCloak has a preview feature that could potentially be used: Fine Grain Admin Permissions. As the name implies it allows to control the administration permissions at a fine granularity.

A potential setup could like so:

  • Create a group (e.g. org-123) for each organization that requires self-administration in Keycloak.
  • Add all users of that organization to group org-123.
  • Create another group (e.g. org-123-admin) for the administrators of the organizations and assign the administrator users to it.
  • Enable permissions on group org-123 and create a permission on this group:
    • Resource: the group org-123
    • Scopes: view-members and manage-members
    • Policy: new policy of type group that includes the group org-123-admin
  • Assign the role query-users of the client realm-management to the administrator users

Administrator users should now be able to login to the dedicated console https://keycloak.domain-name.com/auth/admin/realm-name/console/#/realms/realm-name/users. They can search for users and will only find the users in the group org-123. And they can modify these users.

It depends on your use case whether this is fine-granular enough or not. Possibly the administrators can modify too many things on a user.

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