@W-21581935: Add passthrough auth#241
Merged
anyoung-tableau merged 23 commits intomainfrom Mar 17, 2026
Merged
Conversation
5 tasks
anyoung-tableau
commented
Mar 11, 2026
docs/docs/configuration/mcp-config/authentication/passthrough.md
Outdated
Show resolved
Hide resolved
anyoung-tableau
commented
Mar 13, 2026
anyoung-tableau
commented
Mar 13, 2026
anyoung-tableau
commented
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional “passthrough auth” path for HTTP deployments so clients (or a trusted gateway/proxy) can authenticate MCP requests using Tableau REST credentials supplied via X-Tableau-Auth or workgroup_session_id, taking precedence over the configured AUTH mode (including OAuth).
Changes:
- Introduces
passthroughAuthMiddlewareto extract/validate Tableau credentials (with optional in-memory caching). - Updates REST API instantiation to reuse provided credentials and avoid signing out for passthrough sessions.
- Adds config/env plumbing, CI wiring, tests, and new documentation for passthrough auth.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| types/process-env.d.ts | Adds env var typings for passthrough auth toggles/interval. |
| tests/oauth/embedded-authz/oauth.test.ts | Adds OAuth-suite tests for X-Tableau-Auth header and workgroup_session_id cookie flows. |
| src/testSetup.ts | Extends RestApi mocks with credential-setter methods. |
| src/server/passthroughAuthMiddleware.ts | New middleware: extracts header/cookie, validates session, caches auth info, sets req.auth. |
| src/server/oauth/schemas.ts | Extends auth info schema union to include Passthrough auth info. |
| src/server/oauth/authMiddleware.ts | Skips OAuth auth when a previous middleware already populated req.auth. |
| src/server/express.ts | Wires cookie parsing + passthrough middleware (behind config flag) and adjusts CORS headers. |
| src/scripts/createClaudeMcpBundleManifest.ts | Adds passthrough env var metadata to the bundle manifest generator. |
| src/restApiInstance.ts | Supports Passthrough auth info (set credentials; skip sign-out); refactors return shape for sign-out decision. |
| src/restApiInstance.test.ts | Expands coverage for PAT/direct-trust/UAT/OAuth and adds Passthrough credential test. |
| src/config.ts | Parses new passthrough env vars into Config. |
| src/config.test.ts | Adds unit tests for new config values/defaults. |
| package.json | Adds cookie-parser dependency and @types/cookie-parser. |
| package-lock.json | Locks new cookie-parser-related dependencies. |
| docs/docs/configuration/mcp-config/authentication/passthrough.md | New docs page describing passthrough auth and env vars. |
| docs/docs/configuration/mcp-config/authentication/README.md | Links to passthrough auth docs. |
| .github/workflows/ci.yml | Adds Connected App/JWT env vars for CI. |
| .github/actions/run-oauth-embedded-authz-tests/action.yml | Enables passthrough auth in embedded OAuth test action env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/docs/configuration/mcp-config/authentication/passthrough.md
Outdated
Show resolved
Hide resolved
|
Just tested out the PR in it's current state and works perfectly with out internal infra 🎉 |
stephendeoca
approved these changes
Mar 16, 2026
yyk16293
approved these changes
Mar 16, 2026
|
@anyoung-tableau Would you mind creating a new release? Then I can give it a try internally :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR originated from #234 and the discussion on it.
Fixes #237
This PR introduces "pass through" auth which allows clients to provide the Tableau access token used by the REST APIs to be provided directly on the
X-Tableau-Authheader orworkgroup_session_idcookie. This allows for user-less agents, both external or internal, to use Tableau MCP without being forced to authenticate interactively or provide a client credential.When enabled, this auth method complements the default auth method configured on the
AUTHenvironment variable. That is, requests with theX-Tableau-Authheader will take precedence over whatever form of auth would have occurred otherwise. This includes OAuth. See the new docs page for more details.