Using Oauth for Connection Credentials for publishing the workbook using TableauServerClient library
We have a Jenkins pipeline to run the job for publishing workbooks. We have a use case for a workbook that uses live Athena datasource using oauth for data connection. I added the code to use oauth based on the documentation, but it's not very clear. FYI, the workbook is getting published manually.
1- What is expected in the parameters when using oauth- username, password, embed etc. What value is expected?-
ConnectionCredentials(name, password, embed=False, oauth=True)
2- The job is failing but it's not giving proper error message to describe the issue so i am clueless. Also why the value of "started_at" is None?
18:20:38 === Detailed Error Information ===
18:20:38 job_info: <Job#xxxxxxxxxxxxx PublishWorkbook created_at(2025-06-20 12:50:28+00:00) started_at(None) completed_at(2025-06-20 12:50:28+00:00) progress (100) finish_code(1)>
18:20:38 Job ID: XXXXXXXXXXXX
18:20:38 Job type: PublishWorkbook
18:20:38 Job mode: Asynchronous
18:20:38 Job notes: N/A
18:20:38 Job created at: 2025-06-20 12:50:28+00:00
18:20:38 Job started at: None
18:20:38 Job completed at: 2025-06-20 12:50:28+00:00
18:20:38 Job progress: 100
18:20:38 Job finish code: 1
Also let me know if i am missing out on anything.
Versions
Details of your environment, including:
- Tableau Server version- 2024.2.2 (20242.24.0807.0327) 64-bit Linux
- Python version- 3.9
- TSC library version- 0.15.0
What are the results or error messages received?
18:20:38 === Detailed Error Information ===
18:20:38 job_info: <Job#xxxxxxxxxxxxx PublishWorkbook created_at(2025-06-20 12:50:28+00:00) started_at(None) completed_at(2025-06-20 12:50:28+00:00) progress (100) finish_code(1)>
18:20:38 Job ID: XXXXXXXXXXXX
18:20:38 Job type: PublishWorkbook
18:20:38 Job mode: Asynchronous
18:20:38 Job notes: N/A
18:20:38 Job created at: 2025-06-20 12:50:28+00:00
18:20:38 Job started at: None
18:20:38 Job completed at: 2025-06-20 12:50:28+00:00
18:20:38 Job progress: 100
18:20:38 Job finish code: 1
@Priya Upadhyay
Hi,
a. When you use Oauth, you should NOT add the password in the credential. You should ADD the username. That username must match one credential stored under the my account settings of the user who has signed with TSC.
This behaviour is the same when you publish from Tableau Desktop using an Oauth connection. You need to embed the oauth connection that is already stored under my account settings.
b. It seems for me, that you are using a really old release of TSC. You mentioned 0.15, while the current one is 0.38. I suggest you to upgrade your TSC library.
If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.
Regards,
Diego Martinez
Tableau Visionary and Forums Ambassador