-
Notifications
You must be signed in to change notification settings - Fork 448
Update JWT Login Docs to include Unified Access Token, and and fix PAT table formatting #1718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rubywerman
wants to merge
1
commit into
tableau:gh-pages
Choose a base branch
from
rubywerman:dev/ruby/uat-docs
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,20 +23,22 @@ In most cases this is the preferred method because it improves security by avoid | |
| To sign in to Tableau Server or Tableau Cloud with a personal access token, you'll need the following values: | ||
|
|
||
| **Tableau Server** | ||
| Name | Description | ||
| :--- | :--- | ||
| TOKEN_NAME | The personal access token name (from the My Account settings page) | ||
| TOKEN_VALUE | The personal access token value (from the My Account settings page) | ||
| SITENAME | The Tableau Server site you are authenticating with. For example in the site URL http://MyServer/#/site/MarketingTeam/projects, the site name is MarketingTeam. In the REST API documentation, this field is also referred to as contentUrl. This value can be omitted to connect with the Default site on the server. | ||
| SERVER_URL | The Tableau Server you are authenticating with. If your server has SSL enabled, this should be an HTTPS link. | ||
|
|
||
| | Name | Description | | ||
| | --- | --- | | ||
| | TOKEN_NAME | The personal access token name (from the My Account settings page) | | ||
| | TOKEN_VALUE | The personal access token value (from the My Account settings page) | | ||
| | SITENAME | The Tableau Server site you are authenticating with. For example in the site URL http://MyServer/#/site/MarketingTeam/projects, the site name is MarketingTeam. In the REST API documentation, this field is also referred to as contentUrl. This value can be omitted to connect with the Default site on the server. | | ||
| | SERVER_URL | The Tableau Server you are authenticating with. If your server has SSL enabled, this should be an HTTPS link. | | ||
|
|
||
| **Tableau Cloud** | ||
| Name | Description | ||
| :--- | :--- | ||
| TOKEN_NAME | The personal access token name (from the My Account settings page) | ||
| TOKEN_VALUE | The personal access token value (from the My Account settings page) | ||
| SITENAME | The Tableau Cloud site you are authenticating with. For example in the site URL https://10ay.online.tableau.com/#/site/umbrellacorp816664/workbooks, the site name is umbrellacorp816664. In the REST API documentation, this field is also referred to as contentUrl. This value is always required when connecting to Tableau Cloud. | ||
| SERVER_URL | The Tableau Cloud instance you are authenticating with. In the example above the server URL would be https://10ay.online.tableau.com. This will always be an an HTTPS link. | ||
|
|
||
| | Name | Description | | ||
| | --- | --- | | ||
| | TOKEN_NAME | The personal access token name (from the My Account settings page) | | ||
| | TOKEN_VALUE | The personal access token value (from the My Account settings page) | | ||
| | SITENAME | The Tableau Cloud site you are authenticating with. For example in the site URL https://10ay.online.tableau.com/#/site/umbrellacorp816664/workbooks, the site name is umbrellacorp816664. In the REST API documentation, this field is also referred to as contentUrl. This value is always required when connecting to Tableau Cloud. | | ||
| | SERVER_URL | The Tableau Cloud instance you are authenticating with. In the example above the server URL would be https://10ay.online.tableau.com. This will always be an an HTTPS link. | | ||
|
|
||
| This example illustrates using the above values to sign in with a personal access token, do some operations, and then sign out: | ||
|
|
||
|
|
@@ -82,10 +84,14 @@ server.auth.sign_out() | |
|
|
||
| ### Sign in with JSON Web Token (JWT) | ||
|
|
||
| If you have Connected Apps enabled, you can create JSON Web Tokens and use them to authenticate over the REST API. To learn about Connected Apps, read the docs on [Tableau Connected Apps](https://help.tableau.com/current/server/en-us/security_auth.htm#connected-apps) | ||
| If you have Connected Apps enabled, you can create JSON Web Tokens and use them to authenticate over the REST API. To learn about Connected Apps, read the docs on [Tableau Connected Apps](https://help.tableau.com/current/server/en-us/security_auth.htm#connected-apps). | ||
|
|
||
| To sign in to Tableau Server or Tableau Cloud with a JWT, you'll need to have created a Connected App and generated the token locally (see [instructions to generate a JWT for your Connected App](https://help.tableau.com/current/server/en-us/connected_apps.htm#step-3-configure-the-jwt)): | ||
|
|
||
| Starting in December 2025 with REST API version 3.27, Tableau Cloud also accepts a Unified Access Token (UAT) as a JWT-based authentication mechanism. UATs are configured via the [Tableau Cloud Manager REST API](https://help.tableau.com/current/api/cloud-manager/en-us/reference/index.html#tag/Authentication-Methods/operation/createUatConfiguration). | ||
|
|
||
| To learn more about Unified Access Token, read the docs on [Unified Access Tokens](https://help.tableau.com/current/api/cloud-manager/en-us/docs/unified_access_tokens.html#sign-in-to-tableau-rest-api). | ||
|
|
||
| ```py | ||
| class JWTAuth(Credentials): | ||
| def __init__(self, jwt=None, site_id=None, user_id_to_impersonate=None): | ||
|
|
@@ -96,13 +102,19 @@ Name | Description | |
| JWT | The generated token value | ||
| SITENAME | The same as described for personal access tokens | ||
| SERVER_URL | The same as described for personal access tokens | ||
| isUat | (Tableau Cloud only) Set to `True` when authenticating with a Unified Access Token JWT. Leave it unset (or `False`) when signing in with a Connected App JWT. | ||
|
|
||
| This example illustrates using the above values to sign in with a JWT, do some operations, and then sign out: | ||
|
|
||
| ```py | ||
| import tableauserverclient as TSC | ||
|
|
||
| # Connected App JWT | ||
| tableau_auth = TSC.JWTAuth('JWT', 'SITENAME') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest making both of these examples more clear by providing the argument name as well (better practice), |
||
|
|
||
| # UAT JWT | ||
| tableau_auth = TSC.JWTAuth('JWT', 'SITENAME', isUat=True) | ||
|
|
||
| server = TSC.Server('https://SERVER_URL', use_server_version=True) | ||
| server.auth.sign_in(tableau_auth) | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add
isUathere as well