KNOWLEDGE BASE

Not able to signin to Tableau Server using JSON Web Token


Published: 24 Jul 2023
Last Modified Date: 25 Jul 2023

Issue

Unable to access authenticate to Tableau server using JSON Web Token (JWT), hence not able to programatically authorize access to Tableau REST API on users' behalf using JSON Web Token (JWT).
Error message:
 

<error code="401001">
<summary>Signin Error</summary>
‹detail›Error signing in to Tableau Server‹/detail>

Environment

  • Tableau Server
  • 3 party application used to send a request to the API endpoint that handles authentication.
  • Tableau Connected Apps feature used.

Resolution

  • Upgrade to Tableau server version 2022.3 or higher.
Versions of the REST API are made available with releases of Tableau Server and signing in with a JSON Web Token (JWT), from a connected app was introduced in API 3.17
API version can be verified in the XML Schema Definition (XSD) file location in the response body or by checking the Tableau server version.
  • Setting the expiration time of the JWT to 15 minutes or lower.
When a JWT expires, it will no longer be accepted by the system that it is used to authenticate with. Setting it to more that 15 minutes will result in sign-in error 401001.
Expiry time can be set in the JSON payload used to generate JWT. If python is used, then below command is used to set the expiry time.
"exp": datetime.datetime.utcnow() + datetime.timedelta(minutes=5)

In both these scenarios, authentication with other methods like username password and PAT will be successful.
 

Cause

Below are some of the causes.
  • Signing in with a JSON Web Token (JWT), from a connected app was introduced in Tableau Server 2022.3 (API 3.17)). Hence, Authentication will fail if Tableau server version is lower that 2022.3
  • The expiration time of the JWT was set to more that 15 minutes.
Did this article resolve the issue?