You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Personal access token method for Tableau Connection #25904
I would like to use the Personal Access Token method for API calls to Tableau.
I see 2 solutions that might be applicable:
Create 1 connection to Tableau and use that for all API calls from Airflow in a specific timeframe. I am not sure if this is feasible
Create a pool of tokens and for each connection to Tableau from Airflow, create a new connection id with 1 of the unused tokens. I saw that on Airflow, you can generate connection on the fly. I am not sure how to handle the token pool though
I am open to other solutions and guidance. Also, I am not sure I can submit a PR since I have never contributed to an open source project but I can try.
Create 1 connection to Tableau and use that for all API calls from Airflow in a specific timeframe. I am not sure if this is feasible
Create a pool of tokens and for each connection to Tableau from Airflow, create a new connection id with 1 of the unused tokens. I saw that on Airflow, you can generate connection on the fly. I am not sure how to handle the token pool though
As I understand from Tableau Python SDK docs, there are no parameters for PersonalAccessTokenAuth class that we can use to mitigate the issue.
The problem is that only 1 connection can be used for each token simultaneously.
Again, I am not sure how to solve it but Tableau Python SDK doesn't seem to hold the answer.
I looked at this issue again and when an authentication is made with a PAT then the site_id and credentials_token are obtained. credentials_token is valid for 4 hours and should be able to be used with parallel processes. Hence, for PATs, the Airflow code should use the obtained site_id and credentials_token after the first authentication and not create a new ones from the PATs (unless 4 hours passed)
Hi,
I have the same problem to use Tableau with PAT. Any progress on this? Which option have you chosen?
We were thinking of putting the tasks in airflow pools and having a pool of tokens
Hey, I am posting a comment here as, now, MFA is enforced on Tableau cloud. Thus, user/password is not available anymore for Tableau connection with a service account.
For now, I am using multiple token (1 for each concurrent task).
Reacted by Armand Duijn, Thiago Baldim, Alex D'Ambra, yianniscon, RafaelAMello and Benedikt Buchert
Yeah, that is the same here. With the MFA enforced, we are using multiple tokens. But the library with the tokens is pretty broken and not even recommended by Airflow to be used. Would love to see a solution for this and ensure a better handling of this weird:
401002: Unauthorized Access
Invalid authentication credentials were provided.
Yeah, that is the same here. With the MFA enforced, we are using multiple tokens. But the library with the tokens is pretty broken and not even recommended by Airflow to be used. Would love to see a solution for this and ensure a better handling of this weird:
401002: Unauthorized Access
Invalid authentication credentials were provided.
Yeah. submitting a PR to this one is most welcome. Also (not sure how tableau does it) but various services usually allow to generate token - usually with limited capabilities - and use it as a password when MFA is enabled (for example GitHub does it - you can authenticate with your login (which is not really needed and can be anything) and provide the token as password. Maybe (guessing) Tableau has similar feature.
Heads-up for users who rely on the deprecated PAT authentication method.. The Airflow 2.10.5 release bumped the tableau provider to 5.0.0. This new major version removes support for PAT.
Reacted by Baruch Shteken, RafaelAMello and Benedikt Buchert
As mentioned before, we can support connection methods that Tableau SDK allows. If the SDK doesn't offer the needed option then I suggest to contact Tableau and ask them to address it.
As mentioned before, we can support connection methods that Tableau SDK allows. If the SDK doesn't offer the needed option then I suggest to contact Tableau and ask them to address it.
Sign in with Personal Access Token
In most cases this is the preferred method because it improves security by avoiding the need to use or store passwords directly.
This is the SDK used by the provider, right?
In our team we have been using the provider with the PAT successfully, aware of the limitation of one active connection at a time. This is how we mitigate it when refreshing data sources (our main use case of the provider):
one pool of 1 slot per connection
set blocking_refresh=False on TableauOperator
use TableauJobStatusSensor to wait for the refresh to complete
That way , we can refresh multiple data sources concurrently with a single connection. I hope it's useful to anyone. Having multiple connection is also a valid option.
With the removal of PAT support in version 5.0.0, as Tableau Cloud users with MFA enforced, as far as I understand, we can't use this provider anymore. Maybe other teams are impacted similarly?
So I'm having a hard time understanding why support for PAT was deprecated and dropped. Am I missing something obvious?
If not, shall it be brought back, with a section in the docs to explain how to work around PAT's limitation? (happy to contribute to the doc).
So I'm having a hard time understanding why support for PAT was deprecated and dropped
See #16916
Tableau users were impacted badly due to this.
The situation/deprecation has been known for +-3 years? Airflow has a mixed governance model for providers which means that at any point Tableau are welcome to join the effort and participate in maintaining the code and the users questions. It works really well with AWS, Google, Teradata and other companies.
shall it be brought back, with a section in the docs to explain how to work around PAT's limitation?
Given the situation I am not sure this is the right direction. Operators should just work. They should not have complex workarounds. Any integration that doesn't allow this means that something is missing in the integration SDK. As a Rule - Airflow does not create complex workarounds to mitigate missing functionality in upstream SDKs.
Should Tableau take active role in the project and it will be their professional recommendation we can have a discussion then.
I assume it may not be the answer you were hoping for (and I am open to be convinced otherwise) but I am having difficulties proceeding without Tableau offering their official guidance and involvement.
I believe we should be able to replace PAT with JWT token, and that should be allow multiple connections. Shame I don't have access to Tableau anymore :( Trial only last for 2 weeks, I'll see what I can do in that time.
Elad, thanks a lot for pointing to the PR and your explanation. Now I think I get the reasoning.
It's a valid one: I also prefer when operators just works.
However in this case, we went from: a not ideal situation (some care is needed to use the provider with PAT if concurrency is needed) to: the provider is completely unusable for Tableau Cloud users. In my opinion, the provider was not improved as a result.
If using PAT presented a security risk, removing the feature would be a good thing, but as far as I understand, that is not the case.
About workarounds: it's a matter of perceptions, but I don't find using pools, blocking_refresh=False and a sensor very complex. There is no code smell, no hack. It's using Airflow's and the provider's capabilities to make something work. Indeed, generally, I prefer to use just one operator with all defaults (AKA "it just works"). Airflow's pools exist because "Some systems can get overwhelmed when too many processes hit them at the same time.". Well, Tableau gets overwhelmed when more than 1 process hits it at the same time.
Now, Tableau Cloud users must either:
stick to Airflow < 2.10.5
play with the requirements to pin the provider's version
not use the provider, and implement a custom task, which surely goes against the spirit of reusing community-provided operators to avoid reinventing the wheel
I strongly prefer tweaking my DAG a bit to use the provider than any of these 3 alternatives I could think of.
Regarding Tableau's involvement, are you aware of any contact attempt?
You need to consider also the mantainers prespective. We get questions/troubleshooting issues/bug reports and we are all volunteers here. I am not willing to take on explaining and triaging Tableau users problems. Tableau is just one integration among many we support. I consider this issue Tableau SDK problem not Airflow problem. We can consider also migrating it outside of Airflow repo to someone who would be willing to own it.
Regarding Tableau's involvement, are you aware of any contact attempt?
You can open issue in thier SDK repo and ask your account manager to assist in getting attention to it.
Now, Tableau Cloud users must either
You can write your own custom provider/operator so you are not blocked.
Activity
boring-cyborg commentedon Aug 23, 2022
Thanks for opening your first issue here! Be sure to follow the issue template!
eladkal commentedon Aug 23, 2022
These are not the way to go.
You need to research how Tableau Python SDK is expecting to make the connection and then add support for it from Airflow side. For example in Google we support 2 options for authentications:
https://airflow.apache.org/docs/apache-airflow-providers-google/stable/connections/gcp.html#authenticating-to-google-cloud
We can probably support any method that the SDK allows. So the action item here is to check what the SDK allows and add proper support for it from Airflow side.
baruch-shteken commentedon Aug 25, 2022
As I understand from Tableau Python SDK docs, there are no parameters for
PersonalAccessTokenAuthclass that we can use to mitigate the issue.The problem is that only 1 connection can be used for each token simultaneously.
Again, I am not sure how to solve it but Tableau Python SDK doesn't seem to hold the answer.
baruch-shteken commentedon Oct 20, 2022
I looked at this issue again and when an authentication is made with a PAT then the
site_idandcredentials_tokenare obtained.credentials_tokenis valid for 4 hours and should be able to be used with parallel processes. Hence, for PATs, the Airflow code should use the obtainedsite_idandcredentials_tokenafter the first authentication and not create a new ones from the PATs (unless 4 hours passed)eladkal commentedon Oct 21, 2022
feel free to submit PR if you have a fix.
you can also write code that regenerate token before it expire. Example: #17951
Rociogonzalez commentedon Feb 28, 2023
Hi,
I have the same problem to use Tableau with PAT. Any progress on this? Which option have you chosen?
We were thinking of putting the tasks in airflow pools and having a pool of tokens
Michae94 commentedon Apr 28, 2023
Hey, I am posting a comment here as, now, MFA is enforced on Tableau cloud. Thus, user/password is not available anymore for Tableau connection with a service account.
For now, I am using multiple token (1 for each concurrent task).
TRBaldim commentedon May 5, 2023
Yeah, that is the same here. With the MFA enforced, we are using multiple tokens. But the library with the tokens is pretty broken and not even recommended by Airflow to be used. Would love to see a solution for this and ensure a better handling of this weird:
potiuk commentedon May 5, 2023
Yeah. submitting a PR to this one is most welcome. Also (not sure how tableau does it) but various services usually allow to generate token - usually with limited capabilities - and use it as a password when MFA is enabled (for example GitHub does it - you can authenticate with your login (which is not really needed and can be anything) and provide the token as password. Maybe (guessing) Tableau has similar feature.
TRBaldim commentedon May 7, 2023
Thanks @potiuk for your comment about the generated tokens. I will check and try to keep this updated.
baruch-shteken commentedon Oct 13, 2023
I opened a PR for this with an idea, I would like to get feedback on it 🙏
simonprydden commentedon Dec 16, 2023
@baruch-shteken would Sign in with JSON Web Token (JWT) work with multiple connections?
Michae94 commentedon Jan 25, 2024
I do think so indeed, as you could dynamically create different JWT tokens for one connected app (Airflow).
https://help.tableau.com/current/online/en-us/connected_apps_direct.htm
armandduijn commentedon Feb 20, 2025
Heads-up for users who rely on the deprecated PAT authentication method.. The Airflow 2.10.5 release bumped the tableau provider to 5.0.0. This new major version removes support for PAT.
eladkal commentedon Feb 20, 2025
As mentioned before, we can support connection methods that Tableau SDK allows. If the SDK doesn't offer the needed option then I suggest to contact Tableau and ask them to address it.
borismo commentedon Feb 20, 2025
In the official doc of the Python SDK, I read:
This is the SDK used by the provider, right?
In our team we have been using the provider with the PAT successfully, aware of the limitation of one active connection at a time. This is how we mitigate it when refreshing data sources (our main use case of the provider):
blocking_refresh=FalseonTableauOperatorTableauJobStatusSensorto wait for the refresh to completeThat way , we can refresh multiple data sources concurrently with a single connection. I hope it's useful to anyone. Having multiple connection is also a valid option.
With the removal of PAT support in version 5.0.0, as Tableau Cloud users with MFA enforced, as far as I understand, we can't use this provider anymore. Maybe other teams are impacted similarly?
So I'm having a hard time understanding why support for PAT was deprecated and dropped. Am I missing something obvious?
If not, shall it be brought back, with a section in the docs to explain how to work around PAT's limitation? (happy to contribute to the doc).
eladkal commentedon Feb 20, 2025
See #16916
Tableau users were impacted badly due to this.
The situation/deprecation has been known for +-3 years? Airflow has a mixed governance model for providers which means that at any point Tableau are welcome to join the effort and participate in maintaining the code and the users questions. It works really well with AWS, Google, Teradata and other companies.
Given the situation I am not sure this is the right direction. Operators should just work. They should not have complex workarounds. Any integration that doesn't allow this means that something is missing in the integration SDK. As a Rule - Airflow does not create complex workarounds to mitigate missing functionality in upstream SDKs.
Should Tableau take active role in the project and it will be their professional recommendation we can have a discussion then.
I assume it may not be the answer you were hoping for (and I am open to be convinced otherwise) but I am having difficulties proceeding without Tableau offering their official guidance and involvement.
simonprydden commentedon Feb 20, 2025
I believe we should be able to replace PAT with JWT token, and that should be allow multiple connections. Shame I don't have access to Tableau anymore :( Trial only last for 2 weeks, I'll see what I can do in that time.
https://help.tableau.com/current/server/en-us/connected_apps_direct.htm#step-3-configure-the-jwt
https://tableau.github.io/server-client-python/docs/sign-in-out#sign-in-with-json-web-token-jwt
borismo commentedon Feb 21, 2025
Elad, thanks a lot for pointing to the PR and your explanation. Now I think I get the reasoning.
It's a valid one: I also prefer when operators just works.
However in this case, we went from: a not ideal situation (some care is needed to use the provider with PAT if concurrency is needed) to: the provider is completely unusable for Tableau Cloud users. In my opinion, the provider was not improved as a result.
If using PAT presented a security risk, removing the feature would be a good thing, but as far as I understand, that is not the case.
About workarounds: it's a matter of perceptions, but I don't find using pools,
blocking_refresh=Falseand a sensor very complex. There is no code smell, no hack. It's using Airflow's and the provider's capabilities to make something work. Indeed, generally, I prefer to use just one operator with all defaults (AKA "it just works").Airflow's pools exist because "Some systems can get overwhelmed when too many processes hit them at the same time.". Well, Tableau gets overwhelmed when more than 1 process hits it at the same time.
Now, Tableau Cloud users must either:
I strongly prefer tweaking my DAG a bit to use the provider than any of these 3 alternatives I could think of.
Regarding Tableau's involvement, are you aware of any contact attempt?
eladkal commentedon Feb 21, 2025
You need to consider also the mantainers prespective. We get questions/troubleshooting issues/bug reports and we are all volunteers here. I am not willing to take on explaining and triaging Tableau users problems. Tableau is just one integration among many we support. I consider this issue Tableau SDK problem not Airflow problem. We can consider also migrating it outside of Airflow repo to someone who would be willing to own it.
You can open issue in thier SDK repo and ask your account manager to assist in getting attention to it.
You can write your own custom provider/operator so you are not blocked.
benedikt-buchert commentedon Apr 24, 2025
FYI https://www.salesforce.com/plus/experience/tableau_conference_2025/series/tableau_success_stories_at_tableau_conference_2025/episode/episode-s1e3
eladkal commentedon Mar 31, 2026
Closing this issue as won't fix.
Whenever Tableau will provide the option in thier SDK this issue can be revisited.