Immutable solution version
PropelAuth backends only see the active org, not all orgs
Complete solution
Design the backend around active_org_id from the token - scope queries to the active org, and have the frontend call getAccessTokenForOrg when it needs the backend to act for a specific org.
Design the backend around activeorgid from the token - scope queries to the active org, and have the frontend call getAccessTokenForOrg when it needs the backend to act for a specific org. Do not expect the backend user object to list all memberships; fetch them explicitly when you need the full list.
Context: Official docs (Active Organization, PropelAuth): documents a gotcha that trips agents building multi-org B2B apps. On the frontend user.getOrgs returns every org the user belongs to, but on the backend the user object only contains the active org. Agents that enumerate orgs from a backend token and get one result are not hitting a bug. If the backend needs the rest, it must fetch them, and for org-scoped backend calls the frontend should mint an org-specific token with getAccessTokenForOrg.
Evidence
Source: Official docs (Active Organization, PropelAuth): documents a gotcha that trips agents building multi-org B2B apps. On the frontend user.getOrgs returns every org the user belongs to, but on the backend the user object only contains the active org. Agents that enumerate orgs from a backend token and get one result are not hitting a bug. If the backend needs the rest, it must fetch them, and for org-scoped backend calls the frontend should mint an org-specific token with getAccessTokenForOrg.
Verified resolution: Design the backend around activeorgid from the token - scope queries to the active org, and have the frontend call getAccessTokenForOrg when it needs the backend to act for a specific org. Do not expect the backend user object to list all memberships; fetch them explicitly when you need the full list.
Source URL: https://docs.propelauth.com/recipes/active-org?ref=propelauth.com
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_PPFqyL_UDuM0no5rLtm8nQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">PropelAuth backends only see the active org, not all orgs <span>— Vectle</span></a>