When authenticating to the Tableau Cloud REST API using a Connected App (Direct Trust) and a JSON Web Token (JWT), the sign-in request fails with a 401 UNAUTHORIZED and the following response body:
{"error":{"summary":"Signin Error","detail":"Error signing in to Tableau Server (16)","code":"401001"}}
This commonly occurs when an automation or integration that worked against Tableau Server is repointed at Tableau Cloud. The Connected App, client ID, secret ID, and secret value are all valid, but the sign-in still fails because the username being supplied (used as the JWT sub claim) is not a valid identity on the Tableau Cloud site.
The typical trigger: the integration sends an on-premise-style username (for example, an Active Directory short name such as DOMAIN\jsmith), which is a valid identity on Tableau Server but does not resolve to a user on Tableau Cloud, where every user is identified by their email address / TableauID.
Work through the following steps in order, stopping when the issue is resolved.
Step 1 — Use the user's Tableau Cloud email address as the sign-in username
On Tableau Cloud, the identity is the user's email address (TableauID), not the short/AD username used on Tableau Server. Supplying the wrong identity as the JWT sub produces the 401001 error.
sub claim) to the user's email address exactly as it appears on the Tableau Cloud site, e.g. jsmith@example.com — not the short name such as DOMAIN\jsmith.Step 2 — Confirm the user exists on the target Cloud site with that email
The JWT only authenticates an existing user; it does not create one. If the email is not present on the site, the sign-in will still fail.
Step 3 — Verify the Connected App and JWT are otherwise valid
If the identity is correct and sign-in still fails, confirm the remaining Connected App requirements.
kid (secret ID) and iss (client ID), and that the secret is still active (not expired or deleted).scp (scopes) claim for the REST API operations being performed, and aud set to tableau.Reference: Tableau Help — Configure Connected Apps with Direct Trust
005390904

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.