Adding org `handle` to the id token’s `organizations` array
I looked everywhere and can’t seem to figure it out! can someone help me?
I’m sure it would be a custom workflow or something but there aren’t that many docs on the subject
we can easily add an
organizations
array but they do not contain the org handles or external_ids6 Replies
Hi Freddie,
When you enable the Organizations (array) additional claim in ID token customization, you get organization
When you enable the Organizations (array) additional claim in ID token customization, you get organization
id
and name
in this format:
- Use the Kinde Management API: After authentication, make API calls to retrieve full organization details including handles and external_ids for each organization the user belongs to.
- Custom workflows: You could create a workflow that triggers during token generation to fetch and include additional organization metadata. Workflows allow you to customize tokens in ways not supported out of the box.
Let me know if this helps, Thanksyeah im trying to add them to the token with custom workflows, it’s a little tough to grasp though! but im making progress I think
it’s hard without type-safety and being able to try it before deploying it to kinde
just calling this already breaks it
yes ive set the env variables right
Hi, Freddie
The JSON parsing error suggests the token endpoint is returning an unexpected response, which usually indicates an authentication issue with the M2M application setup rather than the environment variables themselves.
Even with correct environment variables, this error typically occurs during the initial token exchange.
Here are the key troubleshooting steps: Required Environment Variables The
Thanks
The JSON parsing error suggests the token endpoint is returning an unexpected response, which usually indicates an authentication issue with the M2M application setup rather than the environment variables themselves.
Even with correct environment variables, this error typically occurs during the initial token exchange.
Here are the key troubleshooting steps: Required Environment Variables The
createKindeAPI
method looks for these specific environment variables:
- KINDE_WF_M2M_CLIENT_ID
- KINDE_WF_M2M_CLIENT_SECRET
(ensure this is marked as sensitive)
Required Bindings
Make sure your workflow includes all necessary bindings
M2M Application Setup
Verify your M2M application configuration:
1. The application must have access to the Kinde Management API
2. Grant the required scopes for your intended operations
3. Ensure the Client ID and Client Secret are correctly copied
Let me know your result, hope it helpsThanks
Hey @freddie
Just checking in to see how it's going with those troubleshooting steps. Any result?
Let me know I any assistance needed.
Thanks
hi, i ended up relying on my db instead! thanks
Thanks for the update, totally understandable!
If there is anything I can assist with, feel free to reach out. Always happy to assist.
If there is anything I can assist with, feel free to reach out. Always happy to assist.