K
Kinde3w ago
Igor

get organization custom properties

Hello everyone, quick question. I am trying to get the active organization's custom properties with getOrganization from getKindeServerSession, but it only returns the default properties (I enabled them on the token, but I don't think this is related to this). It also returns all other properties (name included) as null, even though they are set to something in the platform. The org code is properly returned. Any ideas? { orgCode: 'org_xxxxx', orgName: null, properties: { city: undefined, industry: undefined, postcode: undefined, state_region: undefined, street_address: undefined, street_address_2: undefined } }
2 Replies
Igor
IgorOP3w ago
The property I want to get is a simple boolean that tells me the type of the organization. is_investor is_investee is_intermediary and so on.... If this is not possible or recommended I can handle it differently, just wondering if I should change directions or not
Ages
Ages3w ago
Hi Igor,
Thank you for reaching out. I understand that you're encountering an issue where only default properties are returned, and other properties, including orgName, appear as null despite being set in the platform.

To ensure that custom properties are included when retrieving organization details, you may need to customize your tokens to include these properties. Kinde allows customization of access tokens, M2M tokens, and ID tokens using preset custom claims and properties. This customization ensures that additional information, such as your custom properties (is_investor, is_investee, is_intermediary), is included in the tokens. https://kinde.com/pricinghttps://docs.kinde.com/build/tokens/token-customization Steps to Include Custom Properties: 1. Ensure that your custom properties are defined within your Kinde platform. 2. Configure your tokens to include these custom properties. This may involve setting up custom claims that map to your defined properties. 3. When retrieving the organization details, ensure that your application is set up to read these custom claims from the token.
Additional Considerations: - If your application integrates with third-party services, ensure that token formats are compatible. Kinde provides options to enable mapping for third-party services to ensure seamless integration. - https://docs.kinde.com/build/tokens/token-customization - If you're using a specific SDK, ensure that it supports retrieval of custom properties and that it's correctly configured to access them.
By customizing your tokens to include the necessary custom properties, your application should be able to retrieve and utilize these properties as intended. If you need further assistance with this process or have additional questions, please feel free to ask.

Did you find this page helpful?