Hello!
I’m trying to create a rule or something to add the list user’s organizations and it’s roles to the token…:
for example the token would be something like this:
Assuming a user is authorizing through an organization, the org_id should be present in the ID/Access token(s) returned - Please see this article for more details.
Regarding roles specifically, we recommend setting up an Action to add these as a custom claim to tokens:
Without logging in within the context of an organization, I’m not aware of a way to add the Organizations to a user’s id/access token - You could always poll the Management API for a list of Organizations the user is associated with, but again this would be outside the scope of a token.