tableau / rest-api-samples

Samples for the Tableau REST API
MIT License
394 stars 273 forks source link

Not able to use impersonation in Tableau Cloud using REST API #75

Closed debasmitada closed 1 year ago

debasmitada commented 1 year ago

User impersonation in tableu Cloud using REST API (issue): on cloud: when I am trying to impersonate a user through Site Administrator Creator role its showing error :

Code : import tableauserverclient as TSC tableau_auth = TSC.TableauAuth(cloud_cred['username'], cloud_cred['password'], site_id='site',user_id_to_impersonate='user_id') server = TSC.Server(cloud_cred['url'], use_server_version=True) server.auth.sign_in(tableau_auth) Error : Signin Error User ' Site Administrator Creator ' is not a system admin and may not impersonate as another user.

Versions: • Tableau version – 3.15 • Python version -3.9.12

https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_authentication.htm

bcantoni commented 1 year ago

I don't believe that's possible on Tableau Cloud. From that REST API help link you provided, if you scroll down to the examples you'll see:

Signing in with server administrator's personal access token (PAT) to impersonate a user (not available for Tableau Cloud)

The same is true regardless of username/password or PAT for login.

illonage commented 1 year ago

Hi - Impersonation using the REST API is now possible for Tableau Cloud via Connected Apps. More details here.