tableau/server-client-python

cannot query job status when authenticated with JWT

ACronje opened this issue · 3 comments

Describe the bug
Authenticating with JWT I am not able to lookup the status of a job - instead I get a "unauthorized access error". I believe the jobs endpoint is not supported with JWT auth as I don't see a scope for it on this page. This seems strange to me since if I am able to able to kickoff a datasource refresh job and get back it's job ID, I would expect to also be able to lookup the status of that job.

Using a PAT I am able to lookup the job, but we would like to use Connected Apps for our specific use case.

Versions
Details of your environment, including:

  • Tableau Server version (or note if using Tableau Online): using Tableau Cloud
  • Python version: 3.10.12
  • TSC library version: 0.28

To Reproduce

tableau_auth = tsc.JWTAuth(jwt_token, site_id=site_id)
server = tsc.Server(server_url, use_server_version=True)
server.auth.sign_in(tableau_auth)
job_details = server.datasources.refresh(my_datasource_id)
server.jobs.get_by_id(job_id=job_details.id)

Results
I get a 401002 error code

You are correct, this is a bug on the server where this endpoint has not got the correct permissions set. I do not currently have any info about an expected fix.