p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
417 stars 72 forks source link

Questions about organization events #273

Closed shehabghazy closed 1 month ago

shehabghazy commented 1 month ago

Hi everyone,

First of all, I’d like to thank you for your efforts in developing this fantastic extension.

I have two questions regarding my Keycloak configuration. In my realm, I have defined several groups, such as user, super-user, and admin.

Role Creation: Is it possible to create an event that automatically adds roles -inside org- with the same names as these groups when a new organization is created?

Group Assignment: Can I assign a user to specific groups immediately after creating an organization based on organization roles? So it will be something like a mapper from organization roles to realm groups

Any guidance or examples would be greatly appreciated! Thank you

xgp commented 1 month ago

(transferred to keycloak-orgs as the events repo isn't related)

Role Creation: Is it possible to create an event that automatically adds roles -inside org- with the same names as these groups when a new organization is created?

Please see the events documentation for more information about what events are emitted for what changes. You can write an event listener to do whatever you want on an event.

Group Assignment: Can I assign a user to specific groups immediately after creating an organization based on organization roles? So it will be something like a mapper from organization roles to realm groups

As above, write an event listener for custom functionality like this.