Hello Grafana Community,
I’m encountering a persistent issue where the context within Grafana does not seem to update according to the organization context change when making API calls. Specifically, despite switching organizations through the UI and using appropriate service account tokens for each organization, the API consistently returns data from the default organization (e.g., Main.org) and not from the currently active one (e.g., Anonymous).
Details:
• Version: Grafana v10.4.2 (but also tested on v11.2.0)
• Issue: API responses do not reflect the currently active organization after switching via the UI. This problem persists even when using service account tokens that are organization-specific.
• Expected Behavior: API calls should return data corresponding to the active organization based on the service account token provided.
• Steps to Reproduce:
-
Switch organizations in the Grafana UI.
-
Use an API token associated with the newly selected organization.
-
Make API calls to fetch resources (e.g., dashboards).
-
Responses still reflect resources from the initial organization prior to the switch.
Questions for the Community:
-
Has anyone faced similar issues with organization context not updating in API calls?
-
Are there known workarounds or configurations that might influence this behavior?
-
Could this behavior be related to session management or token handling within Grafana’s backend?
Any insights or recommendations would be greatly appreciated as navigating through this has been challenging. Links to documentation or previous discussions on similar topics would also be very helpful.
Thank you in advance for your help and looking forward to your suggestions!