<@U04UQ68083H> i found the organization_id in the ...
# ory-copilot
a
@chilly-king-10285 i found the organization_id in the identity table. can i use it to set the organization and add this to my upstream jwt? i currently use it public metadata field to save the organization id. is the new column for this intention?
b
A message from kapa.ai
Based on the knowledge sources provided, I can offer some insights into your question about using the
organization_id
in the identity table for Ory. Yes, the
organization_id
column in the identity table is indeed intended for associating identities with organizations in Ory's B2B SSO feature. This is a more structured way to handle organization associations compared to using the public metadata field. However, the knowledge sources don't provide specific information about automatically adding this to an upstream JWT. That said, there are a couple of relevant points to consider: 1. As mentioned in the [Identity metadata & traits](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata) documentation, public metadata can be accessed in the frontend without calling admin APIs. This suggests that the
organization_id
column, being part of the identity structure, should also be accessible in a similar manner. 2. There's an open issue discussing the mapping of identity public metadata to id_token in AX consent, as noted in this [GitHub issue](https://github.com/ory/network/issues/323). While this doesn't directly address your question about
organization_id
, it indicates that there's ongoing discussion about including additional identity information in tokens. Given this information, it seems that using the
organization_id
column would be a more appropriate and structured way to associate identities with organizations compared to using the public metadata field. However, the exact method of including this in an upstream JWT isn't explicitly covered in the provided knowledge sources. For the most accurate and up-to-date information on how to use the
organization_id
in your specific use case, I recommend reaching out to Ory support or consulting the latest documentation, as the feature might have been updated or expanded since the creation of these knowledge sources.