Repository navigation
|
Hi, I have recently started using the Organizations feature in Keycloak which has been extremely useful in our multi tenant application. My only problem at the moment is that by default it seems only the Organization name is added to the access token. Is there any way to map the Organization Id into the token, or at least an Organization attribute? I have had a look at the Organization Membership Mapper, but it doesn't appear to have any settings to configure what attributes of the Organization are added ( or am I missing something? ) In my scenario I have a separate Tenant Micro Service which stores additional information about the Tenants / Organizations and ideally I would like to be able to share some kind of ID between it and Keycloak in order to match Organizations up. At the moment I have to do this based on the name of the organization ( as that is what is contained in the Access Token ) and that is not ideal as the name is changeable in keycloak and It means that I am forced to use GUIDS for the name. All I really need is the Id of the Organization to be added to the access token. |
Replies: 4 comments 21 replies
|
Hi, |
|
I had similar problem, and even after doing all this: https://www.keycloak.org/docs/latest/server_admin/#_mapping_organization_claims_ the token did not show up. |
|
If I assign an organization to a user it shows in the token, however if I assign two organizations to a user, none of them shows up. Is there a way to show all organizations in the token? |
|
is there a way that we allow 1 specific realm role to access any organization without the membership of that organization? through the following scope |
Update: with #33495 we can now include the org ids in the claim. I've used @mzvankovich 's original commit, and added a switch to the organization scope mapper to control whether the id is to be included or not (similar to what we do with attributes). Tests were also added along with doc updates. This will be in Keycloak 26.
Thanks for discussion and the contributions, @mzvankovich and @magoogli !