Enabling OAuth
Tableau Server 2025.3+ only. Full Tableau Cloud is not supported yet but is coming soon ETA Q2 2026.
Until then, enabling OAuth support against a Tableau Cloud site will only work when the MCP server
is accessed using a local development URL e.g. http://127.0.0.1:3927/tableau-mcp.
When a URL for OAUTH_ISSUER is provided, the MCP server will act as an OAuth 2.1 resource server,
capable of accepting and responding to protected resource requests using encrypted access tokens.
When enabled, MCP clients will first require logging in via Tableau OAuth to connect to the MCP
server. For more information, please see the
MCP Authorization spec.
Environment Variables
When OAuth is enabled, the following environment variables also apply or have additional meaning:
AUTH
The method the MCP server uses to authenticate to the Tableau REST APIs.
- Defaults to
oauthwhen OAuth is enabled. - Can still be set to other authentication methods. See Authentication for options.
- When set to a value other than
oauth, the MCP server will still be protected from unauthorized access by OAuth but will not use the Tableau session initiated by the Tableau OAuth flow to authenticate to the Tableau REST APIs. For example, ifAUTHis set topat, the MCP server will use the values ofPAT_NAMEandPAT_VALUEto authenticate to the Tableau REST APIs.
OAUTH_ISSUER
The issuer of the OAuth server. This should be the host of the MCP server.
- Required if
AUTHisoauth. For testing, usehttp://127.0.0.1:3927. - Required if
TRANSPORTishttpunless opted out withDANGEROUSLY_DISABLE_OAUTH.
TRANSPORT
The MCP transport type to use for the server.
- Defaults to
httpwhen OAuth is enabled. - Must be
httpwhen OAuth is enabled.
SERVER
- When
AUTHisoauth, leave this empty to support any Tableau Cloud pod determined by the site the user signed into when connecting to the MCP server.
SITE_NAME
The target Tableau site for OAuth.
- When
AUTHisoauth, leaving this empty means any site will be supported, determined by the site the user signed into when connecting to the MCP server.
OAUTH_REDIRECT_URI
The redirect URI for the OAuth flow.
- Default:
${OAUTH_ISSUER}/Callback - Recommended to not define a value at all and just rely on its default value.
- Path must be
/Callback(case-sensitive).
Tableau Server administrators must also use
tsm to set
oauth.allowed_redirect_uri_hosts to the host of the MCP server.
The value should be the same as OAUTH_ISSUER but without the protocol or any
trailing slash.
tsm configuration set -k oauth.allowed_redirect_uri_hosts -v tableau-mcp.example.com
tsm pending-changes apply
OAUTH_CLIENT_ID_SECRET_PAIRS
A comma-separated list of client ID and secret pairs to be used for OAuth clients that require the use of the client credentials grant type.
- Optional.
- Example:
client1:secret1,client2:secret2 - Client IDs and secrets must be unique and cannot contain colons or commas.
- The
/oauth/tokenendpoint accepts client credentials in the request body or the authorization header. If both are provided, the request body takes precedence. - When an access token is requested with the client credentials grant type:
- No refresh token is issued to the client.
AUTHmust not be set tooauthsince there is no Tableau user associated with the access token. The user context must come from the user who owns the Personal Access Token or from the value of theJWT_SUB_CLAIMenvironment variable.
Example /oauth/token request body:
{
"grant_type": "client_credentials",
"client_id": "clientId",
"client_secret": "secret"
}
Example /oauth/token request header:
Authorization: Basic Y2xpZW50SWQ6c2VjcmV0
Where Y2xpZW50SWQ6c2VjcmV0 is the base64 encoding of clientId:secret.
OAUTH_JWE_PRIVATE_KEY
The RSA private key used to decrypt the OAuth access token.
-
It or
OAUTH_JWE_PRIVATE_KEY_PATHmust be provided, but not both. -
Only PEM format is supported.
-
Examples:
-----BEGIN RSA PRIVATE KEY-----\nMIIE...HZ3Q==\n-----END RSA PRIVATE KEY-----
or
-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIJ...te1w==\n-----END ENCRYPTED PRIVATE KEY-----
The access token issued by the MCP server is encrypted using JWE (JSON Web Encryption) using an RSA public key. This public key is derived from the provided RSA private key.
MCP clients provide this encrypted access token to the MCP server on the Authorization header of
its requests. The MCP server decrypts the access token using the provided private key and uses the
Tableau access token held within to authenticate subsequent requests to Tableau APIs. Any requests
to the MCP server that do not have a valid access token will be rejected.
If you need a private key, you can generate one using openssl-genrsa e.g.
openssl genrsa -out private.pem
OAUTH_JWE_PRIVATE_KEY_PATH
The absolute path to the RSA private key (.pem) file used to decrypt the OAuth access token.
- It or
OAUTH_JWE_PRIVATE_KEYmust be provided, but not both. - Only PEM format is supported.
OAUTH_JWE_PRIVATE_KEY_PASSPHRASE
The passphrase for the private key if it is encrypted.
OAUTH_AUTHORIZATION_CODE_TIMEOUT_MS
The timeout for the OAuth authorization codes.
- Default: 10 seconds.
- Max: 1 hour.
OAUTH_ACCESS_TOKEN_TIMEOUT_MS
The timeout for the OAuth access tokens.
- Default: 1 hour.
- Max: 30 days.
OAUTH_REFRESH_TOKEN_TIMEOUT_MS
OAuth support is currently in beta, and the present implementation retains refresh tokens in memory. Consequently, a server administrator's action of stopping and restarting the server, potentially during an upgrade, will result in the loss of all refresh tokens.
Any access tokens actively utilized by MCP clients will remain functional until their expiration, but subsequent attempts to refresh these tokens will fail, requiring the user to sign out and then sign back in.
This issue also pertains to authorization codes, though its impact is less likely due to their significantly shorter expiration window. This limitation will be addressed in a later release.
The timeout for the OAuth refresh tokens.
- Default: 30 days.
- Max: 1 year.
DANGEROUSLY_DISABLE_OAUTH
When TRANSPORT is http, the default behavior changes to require protecting your MCP server with
OAuth as a security best practice.
To opt out of this behavior at your own risk, set DANGEROUSLY_DISABLE_OAUTH to true.
This is not recommended as your MCP server will not be protected from unauthorized access. By explicitly disabling OAuth, you accept any and all risks associated with this decision.
- Default:
false
Sequence Diagram
Key Components
Grant Types
The MCP server supports three OAuth 2.1 grant types:
-
Authorization Code Grant (with PKCE): Interactive flow requiring user authentication
- User must authenticate with Tableau Server
- Supports refresh tokens for long-term access
- Uses PKCE for security
- Suitable for interactive applications
-
Client Credentials Grant: Non-interactive flow for service-to-service authentication
- No user authentication required
- No refresh tokens issued
- Uses pre-configured client ID/secret pairs
- Suitable for automated systems and APIs
-
Refresh Token Grant: Used to obtain new access tokens
- Only available for authorization code grants
- Automatically refreshes Tableau tokens when possible
- Falls back to existing tokens if refresh fails
Security Features
- PKCE (RFC 7636): Code challenge/verifier for public clients (authorization code only)
- JWE Encryption: Access tokens encrypted with RSA-OAEP-256/A256GCM
- State Validation: Prevents CSRF attacks (authorization code only)
- Time-limited Tokens: Authorization codes (10 seconds), access tokens (1 hour), refresh tokens (30 days)
- Client Credential Verification: Secure comparison using timing-safe operations
Token Types
- Tableau OAuth Tokens: Direct from Tableau Server (authorization code only)
- MCP Authorization Code: Short-lived code for token exchange (authorization code only)
- MCP Access Token: JWE-encrypted token containing Tableau credentials or client info
- MCP Refresh Token: For obtaining new access tokens (authorization code only)
Endpoints
/.well-known/oauth-protected-resource: Resource metadata discovery/.well-known/oauth-authorization-server: Authorization server metadata/oauth/register: Dynamic client registration/oauth/authorize: Authorization endpoint with PKCE (authorization code only)/Callback: OAuth callback handler (authorization code only)/oauth/token: Token exchange and refresh (all grant types)