p2-inc / keycloak-orgs

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

How can I add a custom role to a member during registration to the organisation ? #215

Closed priyabrata-munshify closed 7 months ago

priyabrata-munshify commented 7 months ago

Hello,

I created a custom role - role1, I want the role to be added implicitly to all the members who join the organisation. How can I do that ?

xgp commented 7 months ago

There is a membership event that is emitted when a user joins an organization. You could write an event listener that adds them to the role.