10 Replies
shikharTS
shikharTS4mo ago
Can you post the code snippet where you are calling the init function and getting the token here? Also a HAR file would be helpful
Raaghul Umapathy
Raaghul UmapathyOP4mo ago
init({ thoughtSpotHost: "https://vizio.thoughtspot.cloud", authType: AuthType.TrustedAuthToken, username: "selfserve_app", getAuthToken: () => { return fetch("https://vizio.thoughtspot.cloud/api/rest/2.0/auth/token/full", { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify( { username: "xxx", validity_time_in_sec: 300, auto_create: false, secret_key: ${thoughtspotKey} }) } ) .then(response => response.json()) .then(data => data.token); } }); @shikharTS ^^
Raaghul Umapathy
Raaghul UmapathyOP4mo ago
@shikharTS shared HAR here ^^ @shikharTS Do you need anything else from me? This is pretty high priority for us.
shikharTS
shikharTS4mo ago
From the HAR it says
Service Secret code is not valid
Service Secret code is not valid
This is the payload going to TS
auto_create: false
secret_key: "[object Object]"
username: "selfserve_app"
validity_time_in_sec: 300
auto_create: false
secret_key: "[object Object]"
username: "selfserve_app"
validity_time_in_sec: 300
Raaghul Umapathy
Raaghul UmapathyOP4mo ago
@shikharTS how to fix it? what needs to be passed?
shikharTS
shikharTS4mo ago
The secret key string provided by the ThoughtSpot application server. ThoughtSpot generates a secret key when Trusted authentication is enabled.
The secret key string provided by the ThoughtSpot application server. ThoughtSpot generates a secret key when Trusted authentication is enabled.
https://developers.thoughtspot.com/docs/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fauthentication%2Fget-full-access-token
REST API v2.0 Playground
ThoughtSpot REST API v2.0 Playground
shikharTS
shikharTS4mo ago
You are sending [object Object] looks like a coding error..
Raaghul Umapathy
Raaghul UmapathyOP4mo ago
oh yeah. That we are providing as part of the request. not sure why it is invalidating others request but not mine. @shikharTS FYI the application has been deployed in AWS ECS even in my local machine, in 1st browser it is working fine but then in the secondary browser, it says not logged in.
shikharTS
shikharTS4mo ago
So for secondary browser do you have cookies disabled? Since you are using TrustedAuth, you will need to enable 3rd party cookies. If you don't want to do that, you can use TrustedAuthCookieless. But you will need to figure out why the api load is sending [object Object] for auth token call..

Did you find this page helpful?