Repository navigation
Fixes 33371: Tableau connected app (direct trust JWT) sign-in - #37084
Conversation
Tableau connected apps (direct trust) let an admin give OpenMetadata a credential that is not a person's password or PAT. - TableauConnectedAppAuth (clientId, secretId, secretValue, username), shared by the dashboard and pipeline connections - build_server_config signs a 5-minute HS256 JWT carrying the 7 scopes both connectors need; site_id is passed to TSC.JWTAuth by keyword because its second positional parameter is isUat - Java converters type the new authType so the secret is masked and encrypted - 401 and owner test-connection hints name the connected-app checks - ADR:2026-11-04-tableau-connected-apps-sign-in-with-a-direct-trust-jwt Fixes #33371
- Connected-app connections get their own test-connection error pack, so Basic and PAT connections keep their original hints - One Tableau authType class list serves both Java converters - The clients and build_server_config take TSC's Credentials base class - tests/utils/tableau_connected_app.py replaces the copies in both integration fakes and both unit test files - The exp assertion brackets the signing call, so a slow machine cannot push it past the bound Refs #33371
Tableau Server before 2023.3 refuses connected-app sessions on the Metadata API, so the data-model and flow-lineage hints for a connected app now say so instead of only asking to enable the Metadata API. Basic and PAT hints are unchanged; their texts move into shared constants so the connected-app variants extend them. Refs #33371
A skewed clock makes Tableau refuse the token at sign-in, so the connected-app rejection hint now asks to check it. The ADR states that the pipeline client's transport retries re-send the token on a 429 or 5xx, and the tests share one scope-rejection fixture. Refs #33371
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
✅ SSO Login Nightly — PASSED View workflow run · Commit
Totals: 94 passed · 0 failed · 0 flaky · 0 skipped · duration 18m 10s |
|
|
…d-app-jwt # Conflicts: # openmetadata-ui/src/main/resources/ui/src/jsons/ingestionSchemas/workflow.json
Tableau's REST API reference adds the connected app scopes for Query Views for Workbook, Query Flows for a Site and Get Flow Runs in API 3.27 (Tableau Cloud December 2025 / Server 2025.3), so an older Tableau Server cannot serve the charts or flows the connectors read with a connected app token.
…d-app-jwt # Conflicts: # ingestion/src/metadata/ingestion/source/pipeline/tableaupipeline/client.py
… connected app JWT Collate's reverse metadata reuses the Tableau connection to write workbook descriptions, owners and tags, and view tags. With only the read scopes, Tableau rejects each write with 401002. Add tableau:workbooks:update, tableau:workbook_tags:update/delete and tableau:view_tags:update/delete, measured on Tableau Cloud.
…Tableau The fake accepted any sign-in without a JWT, so a connector that stopped sending its token would still pass both connected-app integration suites. Accept only the test PAT or a JWT that passes direct trust; answer anything else with 401.
…again The pipeline client signed in again with the credentials it was built with. A connected app JWT expires five minutes after it is signed, so a session Tableau ended later in a run could not be renewed. Build the credentials again from the connection on each sign-in; a PAT or password is unchanged.
| # Fresh credentials: a connected-app JWT expires five minutes after it is signed. | ||
| self.tableau_server.auth.sign_in(build_server_config(self.config)) |
There was a problem hiding this comment.
⚠️ Quality: Re-sign-in now builds new credentials; the Accepted ADR says the same ones
_sign_in_again no longer reuses the tableau_server_auth passed to the constructor. It now calls build_server_config(self.config) and signs in with what that returns, so a connected-app connection sends a newly signed JWT. The Accepted record ADR:2026-10-30-tableau-pipeline-sign-in-again still says the client signs in "once with the same credentials". Its Guard list doesn't name the new test, and its Consequences still say connected apps would make the rule unnecessary. This PR rewrites only the connected-app ADR's Context so it points at the old record, and leaves the old record contradicting the code.
The change itself is correct, because a JWT expires five minutes after it is signed. The fix is to revise the sign-in-again record to v2 so its Decision says: "A 401 on any call except /auth/ makes the client sign in once with credentials rebuilt from the connection config, so a connected-app sign-in carries a freshly signed JWT, and resend that call once." Also add ::test_a_connected_app_signs_in_again_with_a_fresh_token to its Guard list.
Revise the Decision and Guard lines of docs/decisions/2026-10-30-tableau-pipeline-sign-in-again.md:
- **Revisions:** v1 2026-10-30 (initial); v2 2026-11-04 (sign in again with credentials rebuilt from the config)
...
A 401 on any call except `/auth/` makes the client sign in once with credentials rebuilt from the
connection config (a connected app gets a freshly signed JWT) and send that call once more with the
new token.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
* test(playwright): refresh stale 2.1 visual baselines and fix shell menu scenes Refresh 32 baselines from the 2.1 nightly (run 44266671648) actuals. Every diff traces to an intended change that arrived with the main merge: Tableau connected-app auth option (#37084), 400px entity summary panel (#37888), unified CopyButton (#37953), new Insights/AdvancedSearch icons (#37973), Data Estate connector counts (#37910) and the users Name/Email columns (#37127, #37998). shell-profile-menu and shell-mode-menu waited for my-data-page, which #38077 removed from /my-data in AI mode; wait for home-landing-page. * test(playwright): complete 2.1 shell and expanded Tableau baselines



Describe your changes:
Fixes #33371
The Tableau dashboard and Tableau pipeline connectors could sign in only with a username and password or a personal access token, and both belong to one person. This PR adds a third
authType,TableauConnectedAppAuth, for Tableau connected apps that use direct trust. A site administrator creates the connected app and a secret. OpenMetadata then signs a short-lived JWT with that secret and signs in as the configured Tableau user.The issue's proposal needed three corrections, all measured on Tableau Cloud 2026.3.2 (REST API 3.30):
401001. RSA keys belong to OAuth 2.0 trust (EAS), which this PR does not cover.TSC.JWTAuthisisUat, sosite_idmust be passed by keyword. Passing it positionally fails sign-in with401001.submust be a real Tableau user, and every call runs with that user's permissions.Type of change:
High-level design:
Schema. New
security/credentials/tableauConnectedAppAuth.jsonwithclientId,secretId,secretValue(format: password) andusername, added to theauthTypeoneOfoftableauConnection.jsonandtableauPipelineConnection.json. The Pydantic models, Java POJOs, UI TypeScript types and dereferenced UI schemas are regenerated; the connection form renders the new option from the schema.Ingestion.
build_server_configindashboard/tableau/connection.py(the pipeline connector imports it) signs the JWT:kid= secret ID,iss= client ID;iss= client ID,sub= username,aud=tableau,exp= 5 minutes, auuid4jti, andscp= the seven scopes both connectors need.It returns
TSC.JWTAuth(jwt=..., site_id=...). The clients take TSC'sCredentialsbase class. Each client signs in once, and the session outlives the token, so there is no refresh. The pipeline client's transport retries re-send that same token on a 429 or 5xx while it is still valid.Fixed values. The scope set and the lifetime are module constants (
CONNECTED_APP_SCOPES,CONNECTED_APP_JWT_LIFETIME), not configuration. ADR:2026-11-04-tableau-connected-apps-sign-in-with-a-direct-trust-jwt records why, and when to revisit.Test connection. A connected-app connection gets its own error pack, chosen from
authTypewhenchecks()builds the provider (without signing in). Basic and PAT connections keep their packs unchanged, which a test compares tomain. The connected-app packs differ in three ways:401002 "Invalid authentication credentials were provided."as bad credentials, so a 401 names the app's checks (client ID, secret, username, enabled, site, host clock) and the scopes.tableau:users:read.Server.
TableauConnectionClassConverterlists the new class, and theTableauPipelineConnectionentry inClassConverterFactoryreuses that same list. Without that, the server rejects a dashboard service with400 "Cannot convert [LinkedHashMap]"and keeps a pipeline service's secret as an untyped map, unmasked and unencrypted. With it, the secret is storedfernet:-encrypted and returned masked.Rejected alternatives.
Compatibility. The new
oneOfbranch is additive, Basic and PAT behave as before, and no migration is needed because stored connections keep their auth types.Tableau Server. Per Tableau's documentation (not live-tested): REST sign-in with a connected app from 2022.3, Metadata API from 2023.3.
subis the user name, not the email, and a new app starts disabled. The connector docs say this.Tests:
Use cases covered
Unit tests
ingestion/tests/unit/source/dashboard/tableau/test_connection.py:kid/issheader,iss/sub/aud/scpclaims, andexp5 minutes after signing, bracketed around the call so a slow machine cannot flake it;jtiper sign-in;ingestion/tests/unit/topology/pipeline/test_tableaupipeline_connection.py: the same token through the pipeline connection config, the connected-app sign-in and lineage hints, and PAT connections keeping theirs.ingestion/tests/utils/tableau_connected_app.py: the shared test credentials, the expected scopes, and the fake Tableau sign-in used by these tests and both integration fakes.openmetadata-service/src/test/java/org/openmetadata/service/secrets/converter/TableauConnectionClassConverterTest.java: a rawauthTypemap becomesTableauConnectedAppAuthfor both connections.main.ValidationErroronauthType. The 2 PAT guard tests pass onmain, as they must.main. With the schema change but not the converter change, the dashboard case fails withCannot convert [LinkedHashMap]and the pipeline case stays aLinkedHashMap.jti, and a missingkidheader each make the tests fail. A 2-second stall inside signing does not.main.pyteston all 10 Tableau unit test files: 324 passed.--cov):dashboard/tableau/connection.py92%, with every new line covered (the misses are older Basic/SSL branches);pipeline/tableaupipeline/connection.py99%.Backend integration tests
The run below is on
73baba6df4c. The later commit,57b301c5982, changes no Java, schema or pom file. Every test it executed passed: 101 unit tests and 5472 integration tests, 0 failures. The block reads FAILED only because 4 selected classes produced no report:CredentialAuthBenchIT,CredentialMemoryIT,CredentialPatBurstITandCredentialSweepCostITare@Tag("scale"), which the IT pom'sexcludedGroups=scalekeeps out of every lane; they belong to the nightly scale suite.IngestionPipelineServiceProgressIT#serviceStreamAppliesPolicyChangesWithoutReconnectingtimed out once in an earlier run on the same Java (SocketTimeoutException: Read timed out, 93 classes in parallel). It uses a Postgres service, not Tableau, passed 13/13 alone, and passed in every run since: 1 failure in 5 runs.Local Java test run: FAILED
73baba6df4c7(baseorigin/main)Selected but produced no report:
CredentialAuthBenchIT (mysql-elasticsearch · parallel),CredentialMemoryIT (mysql-elasticsearch · parallel),CredentialPatBurstIT (mysql-elasticsearch · parallel),CredentialSweepCostIT (mysql-elasticsearch · parallel)Ingestion integration tests
ingestion/tests/integration/tableau/conftest.pyandingestion/tests/integration/tableaupipeline/conftest.py: the fake Tableau sign-in, shared fromtests/utils/tableau_connected_app.py, checks a connected-app JWT the way Tableau does (HS256 with the secret,kid,iss,aud, required claims) and answers 401 otherwise. Every existing workflow test runs once with a PAT and once with the connected app.tests/integration/tableau+tests/integration/tableaupipeline: 30 passed. Onmainthe 14connected_appruns error withParsingConfigurationError, and the 14 PAT runs pass.Playwright (UI) tests
make playwright_affectedselects about 50 specs because the regenerated schema JSONs feed many pages; the merge queue runs the full suite.Manual testing performed
On Tableau Cloud 2026.3.2 (REST API 3.30), against a server built from this branch with its own MySQL and Elasticsearch:
GET .../connected-applicationsreturned{}.get_connection→ test connection), with a PAT control each time. Every arm gave the same result in all 3 trials.tableau:content:readtableau:users:readtableau:flows:readmetadata ingest -c <yaml>for the dashboard and the pipeline connector with a PAT and with the connected app, 3 trials each, each arm on fresh services:Every run exited 0 at 100% success, the lineage edge sets were identical (not just the counts), and the test connection inside each run was
Successful.4. Searched the ingestion logs, DEBUG-level test connection logs and the test connection results, for valid and wrong secrets, for the secret value and any JWT: 0 hits.
5. Created services with the new
authTypeon the branch server:secretValueis storedfernet:-encrypted and returned masked to an admin.UI screen recording:
Not applicable — no UI code changed. The Tableau connection form renders the new authentication option from the regenerated schema (generated TypeScript types and dereferenced connection JSON), and the field help comes from the connector Markdown docs.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed. Not needed: the new
oneOfbranch is additive and stored connections keep their auth types.For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). Not applicable, see above.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Reviewed
57b301c5982(four passes in total, one after each change). Fixed:maintext.expcheck can no longer flake.Answered instead of fixed:
ponytail:comment marks the fixed scope set as a deliberate limit, and the ADR records when to revisit it.Decision check: ADR:2026-11-04-tableau-connected-apps-sign-in-with-a-direct-trust-jwt records the fixed scope set, the five-minute lifetime, HS256 direct trust only, and the Tableau Server floor.
The issue properly describes why the new feature is needed, what's the goal, and how we are building it. The corrections to its proposal are listed above.
I have updated the documentation (
public/locales/en-US/Dashboard/Tableau.md,Pipeline/TableauPipeline.md).I have added tests around the new logic.


Confidence Score: 5/5
The changes appear safe to merge; both previous findings are fixed and no new actionable issue remains.Summary
Adds Tableau connected-app sign-in to the dashboard and pipeline connectors, with shared credentials, JWT signing, server-side secret conversion, and setup documentation.
This review used source inspection; no tests were run.
Diagram
sequenceDiagram participant P as Pipeline client participant B as build_server_config participant T as Tableau P->>T: Read metadata T-->>P: 401 P->>B: Build credentials from saved configuration B-->>P: JWT with fresh expiry and jti P->>T: Sign in T-->>P: New session P->>T: Retry original read onceReviews (6) · Last reviewed commit: "fix(tableaupipeline): sign a fresh conne..." · Reviewed by Greptile