Environment: Tableau Cloud, REST API 3.29, tableauserverclient (Python), Snowflake connection with authentication='oauth', oauth-config-id='default', server-oauth='server-custom'.
ISSUE
We publish workbooks via REST API/PAT in a CI/CD pipeline. We're trying to reproduce a connection state that Tableau Desktop can produce, but the REST API can't.
Desktop-published state (Data Sources tab shows "Not embedded in connection"):
auth_type='oauth' username='<user>' embed_password=False
Our pipeline's state (REST API publish):
auth_type='oauth' username='' embed_password=False
The Desktop state results in viewers being prompted for their own credentials. Ours results in every viewer getting BadOAuthCredentials, since there's no username hint at all.
WHAT WE TRIED
Using Server.workbooks.update_connection() (PUT /workbooks/{id}/connections/{connectionId}), we tested every combination:
1. embed_password=True + username -> credential embeds, all viewers connect silently as that one identity (no prompt).
2. embed_password=False + blank username -> every viewer gets BadOAuthCredentials.
3. embed_password=False + non-empty username (trying to match Desktop) -> the server silently discards the username; a follow-up GET always returns username=''. No error is returned, it just reverts.
4. Re-embedding (embed_password=True) via update_connection without supplying a password fails outright with 404020: Resource Not Found ... This may be due to incorrect or missing credentials. There's no way to flip an OAuth connection back to embedded through this endpoint without a real credential, and OAuth connections have no password-style credential the API can supply.
We confirmed #3 fails identically whether attempted via connections=[ConnectionCredentials(...)] at publish time, or via a separate post-publish update_connection call. Same result both ways.
QUESTIONS
1. Is there any documented REST API mechanism (any endpoint, any API version) to set an OAuth connection to embedPassword=false while preserving a non-empty userName hint, matching what Desktop produces?
2. Is that "not embedded + username hint" state inherently tied to an interactive/vizportal-authenticated session (i.e. genuinely unreachable via PAT/REST), or is there an undocumented parameter/flow we're missing?
3. Is per-viewer OAuth prompting for a Snowflake connection with oauth-config-id='default' expected to work at all when the workbook was published via REST API/PAT, or is this a Desktop-only capability?
Happy to share full request/response payloads if that helps with diagnosis.
#OAuth #Tableau APIs & Embedding
#Tableau Cloud #Tableau Server
#Snowflake
thanks for sharing the details with the community.
What I would try if I were in your shoes: set embed_password=True with your REST API pipeline as usual, then try to unset the embedded password with the VizPortal API. It is undocumented and unofficial, but you just need to trace your browser traffic with dev tools when using the Server UI then google the VizPortal API info a bit to see how to authenticate against it and you will figure it easily if you are a developer.
I checked on my sandbox. It is this endpoint:
