Patrick Zuar - Hi there, Does someone have sa...
Hi there,
Does someone have sample code or advice where to start with a very basic drop down to switch between orgs?
all attempts I have made are resulting in the org switching but then reverting back to my starting org?
I can share my existing code if helpful
6 Replies
Which auth method are you using?
Trusted auth scheme does not allow to switch between orgs
I am using Trusted auth as my portal app stores the api key/ username / thoughtspot URL and we use our own auth login for the portal.
What auth method would you recommend for an embedded application where the users will switch orgs regularly?
in my code i can get the org switching and auth to work for all elements but tha actual liveboard which is presenting the TS GUI version of org selector
thank you in advance @shikharTS
<div class="wrapper">
<section class="content-section">
<div class="panel">
<h3>Organizations</h3>
<div id="org-list" class="panel-content">Loading organizations...</div>
</div>
<div id="org-switcher" class="panel" style="display: none;">
<h3>Switch Organization</h3>
<div class="panel-content">
<div class="current-org-info">
<span class="label">Current:</span>
<span id="current-org-name" class="value">Loading...</span>
</div>
<div class="switcher-controls"> <select id="org-select" class="org-dropdown"></select> <button id="switch-org-btn" class="action-button">Switch</button> </div>
<div id="switch-status" class="status-message"></div> </div> </div> <div class="panel"> <h3>Liveboards</h3> <div class="panel-content"> <div id="liveboard-loading" class="loading">Loading available liveboards...</div> <div id="liveboard-buttons" class="liveboard-buttons"></div> <div id="ts-embed" class="liveboard-container"></div> </div> </div> </section> </div>
<div class="switcher-controls"> <select id="org-select" class="org-dropdown"></select> <button id="switch-org-btn" class="action-button">Switch</button> </div>
<div id="switch-status" class="status-message"></div> </div> </div> <div class="panel"> <h3>Liveboards</h3> <div class="panel-content"> <div id="liveboard-loading" class="loading">Loading available liveboards...</div> <div id="liveboard-buttons" class="liveboard-buttons"></div> <div id="ts-embed" class="liveboard-container"></div> </div> </div> </section> </div>
@shikharTS also how sure are you that this statement is true: Trusted auth scheme does not allow to switch between orgs
From the "Multi-tenancy with Orgs" documentation:
"Starting from 9.2.0.cl, ThoughtSpot supports generating separate secret keys for each Org. To enable this feature on your instance, contact ThoughtSpot Support. When this feature is enabled, Org users can obtain separate authentication tokens to access their Org and switch between Orgs seamlessly."
Source: https://developers.thoughtspot.com/docs/orgs
The documentation explicitly mentions that users can switch between organizations when using trusted authentication:
"If a user belongs to multiple Orgs, they will see a menu allowing them to switch between the Orgs they belong to."
The trusted authentication documentation also explains that you can define the Org context for a user during authentication:
"The /tspublic/v1/session/auth/token API endpoint also allows you to define the Org context to which the user must be logged in to after successful authentication."
For reference, you can find this information at:
https://developers.thoughtspot.com/docs/orgs
https://developers.thoughtspot.com/docs/trusted-auth-sdk
https://docs.thoughtspot.com/software/latest/trusted-authentication
Multi-tenancy with Orgs
You can now configure your ThoughtSpot instance as a mult-tenant cluster with separate Org containers for your tenants.
Front-end trusted authentication integration
Front-end trusted authentication integration using Visual Embed SDK
Configure trusted authentication | ThoughtSpot Software
Learn how to configure trusted authentication.
@Patrick Zuar trusted auth api also takes in org_id as a parameter. But if we do not give it org_id it will take the last logged in org_id. But there will only be one org that a user will be logged into when logging in using that token. If you want to log into different org, you can request a new token. But I do not think org switcher will work with Trusted Auth.
The documentation explicitly mentions that users can switch between organizations when using trusted authentication: "If a user belongs to multiple Orgs, they will see a menu allowing them to switch between the Orgs they belong to."This is not in relation to trusted auth. There is no mention of trusted auth around this. This is if we log in through UI or through other methods. We explicitely add org while fetching auth token in trusted auth and the user will have access to that org only. But I will have the team explicitely add that org switcher will not work with trusted auth
Here it is https://developers.thoughtspot.com/docs/trusted-auth-token-request-service#_org_enabled_clusters
Token request service
You can configure support for token-based authentication service on ThoughtSpot.