Chaim Platonov - Hey,I'm writing code to sync ...
Hey,
I'm writing code to sync the users of our system with ThoughtSpot.
To create users in the TS I use the just-in-time provisioning
But when I try to set
account_status
to INACTIVE
using update user API I get Unable to update user state to INACTIVE from PENDING. Please activate the user to continue
.
Get current user info returns account_status: 'ACTIVE'
.Solution:Jump to solution
@Chaim Platonov if the user is not activated use reset password api to reset it's password. Post which it will be in active state and then you will be able to use the update api.
18 Replies
@pallav PTAL
Are you trying to make account status INACTIVE for the current user?
You are checking the account status for current user using Get current user info api call you mentioned..
I'm using user with
ADMINISTRATION
privilege to update another user to INACTIVE
and getting the error I mentioned.
I'm checking the status with the token of the user I'm trying to update.@Chaim Platonov did you try activating the said user using tenant admin
How?
the log says the user you are trying to change the state of isn't activated yet
you can generate the token using the admin user credentials from Get Full Access Token API.
I'll try.
getting
Unable to authenticate current user with given token
getting Either your username or password is incorrect. Your account may lock out after multiple successive incorrect attempts
Is chaim-test tenant-admin? You need to call this activate user api with tenant admin token
like this? Getting
Unable to fetch user authentication information from authToken
Can you remove the org_id: thoughtSpotOrganizationId(), while getting full access token. Looks like it needs to run as tenant admin to run this API
Actually it seems you cannot activate a user from pending state. This API might work only for deactivated users. It needs to be activated first. Will confirm this internally
@Satyam Saxena this seems broken can you also check?
We need to create a thoughtspot user without requiring any actions from our customers, but IIUC the only way to activate is using an activation email.
Lets wait for @Satyam Saxena to reply on this thread, but in case you do not receive a reply, I would recommend to create a support ticket so that the relevant team can take this up
In TS UI I see the user as active as well. But for some reason the update user API shows user as PENDING activation
@Tarphon can you use the /api/rest/2.0/users/deactivate API to deactivate the user. Seems some bug with update user API
Solution
@Chaim Platonov if the user is not activated use reset password api to reset it's password. Post which it will be in active state and then you will be able to use the update api.
@Satyam Saxena the TS UI shows user is activated..
Yes, after changing state the ui/api response might show the older state that's because user sync happens only after one of the tenant admin(s) login. In that scenario the state will get updated only once the tenant admin logs in.
After reset password I can update the account status.
Thanks.
Side question: what's the difference between
INACTIVE
and SUSPENDED
(both are shown in the UI as suspended)?