p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
Other
362 stars 65 forks source link

Set roles to user by organizations #194

Closed gadonski closed 4 months ago

gadonski commented 4 months ago

How can I assign roles to users in different organizations?

Example:

ABC Organization User 01 roles:

User 02 roles:

XYZ Organization User 01 roles:

User 02 roles:

xgp commented 4 months ago

@gadonski thanks for the question. It sounds like you are asking about a mix of Realm Roles, Client Roles, and Organization Roles. There is no ability to link a User to Realm Roles and Client Roles on a per Organization basis. That is something that is planned for the future as we are able to get some changes made in Keycloak main.

For now, it is possible to create and map Organization Members (Users) to Organization Roles. More information on how Organizations and their related entities work is here https://phasetwo.io/docs/organizations/