How to switch organization using getAccessTokenSilently

Hello!

We have a front-end usign React 19 and Auth0’s React SDK

I have an use case that we need switch organization clicking in a button that list organizations from an user (API Management).

Actually the last answer of this issue at github: issues/1055
is “we not support new token with new org using getAccessTokenSilently”, but it is from 2023.

In 2025 we have some solution to switch organizations using this method?

I could change organization with loginWithPopup, but not with silently method.

Hi @renan.padilha,

Welcome to the Auth0 Community!

Yes, your findings are correct. We currently do not support retrieving a new access token with a new org when using the getAccessTokenSilently() method.

If this is needed, you could try logging the the user against the other organization with either the loginWithRedirect or loginWithPopup methods and specifying the organization as a query parameter.

Let me know if you have any issues with this.

Thanks,
Rueben

I’m sure many people in the community, myself included, would appreciate an official implementation example of this or a blog post explaining the recommended way of switching from one logged in organization to another

EDIT: This is where my digging in led me to. However there doesn’t seem to be a way to allow a logged in application to switch without having a popup or a redirect

There is a way to inject orgs in token using actions triggers post-login? We have a front-end application (SPA) and we need switch organizations, but i cannot figure out how to get organizations without access API Management, but SPAs cannot access API Management.

Do you have some solution to get organizations dynamically?

The flow is: user do login, list orgs (how to do without api management?), click and loginWithPopup, change org.

I cannot found a way to get organizations from user.