Data Engineering
Blog
Snowflake
3
min read

Tableau <> Snowflake key-pair authentication

Discover how you can use key-pair authentication to connect Tableau to Snowflake.
Author
Chris Wade
Chris Wade
Data & AI Engineer
Tableau <> Snowflake key-pair authentication
Share article

How to connect Tableau to your Snowflake data warehouse...

How can we use key-pair authentication to connect Tableau to Snowflake?

1. Using the ODBC parameters

When opening Tableau Desktop and choosing Snowflake as a data source, the following screen is prompted.

Snowflake Connection Screen

Obviously it’s possible to authenticate using the following protocols:

  • Username and Password
  • SAML IdP
  • OAuth.

Clearly, an option to authenticate using key-pairs is not within that list. When going through the documentation of Snowflake, it clearly states that it’s possible though.

So how can we use key-pairs to connect to Snowflake using the Tableau Desktop interface?

At the bottom part of the authentication screen, it’s possible to Enter custom driver parameters. These parameters can be selected to pass additional configuration parameters to Snowflake if needed.

Using this section will give us the possibility to use key-pairs. The below screenshot shows how to configure the custom driver parameters section.

Snowflake-Tableau-Custom-Driver-Parameter

These parameters are used to establish the connection to Snowflake using key-pairs:

  • Server, Role: These are the standard server and role (optional) you want to select even with a username/password combination.
  • Authentication: Username & Password can be selected although that does not really cover completely the way of authentication.
  • Username: Enter your username.
  • Password: This section can be left blank. The passphrase for the keys will be specified in the custom section.
  • AUTHENTICATOR: This should be specified in the custom section and should state SNOWFLAKE_JWT. This stands for Snowflake JSON Web Token and warns Snowflake that authentication with key-pairs is used.
  • PRIV_KEY_FILE: Mention the path to the keys on your computer. This can be a .pem or a .p8 file.
  • PRIV_KEY_FILE_PWD: Indicate the passphrase here if one is required. If none is required, you can remove this parameter.

Other parameters can be set too. These can be found in the Snowflake documentation.

1. Using a .TDC file

Tableau also supports the use of .tdc files to tune ODBC connections.

This file will recognise the connection type (fe Snowflake) and will overwrite the given parameters with the parameters defined in the .tdc file. More information about .tdc files can be found here.

An example use case of these .tdc files is automation. It’s possible to give Tableau Desktop developers the possibility to log in to Snowflake using named credentials (username & password).

When they upload their work to Tableau Server, where a .tdc is stored, the connection string will be changed and it is possible to automatically assign a technical user on Tableau Server that uses key-pair authentication.

The content of this .tdc file needs to be the following (after changing the credentials).

<connection-customization class='snowflake' enabled='true' version='18.1'>
<vendor name='snowflake' />
<driver name='snowflake' />
<customizations>
<customization name='odbc-connect-string-extras' value='UID=USERNAME;PWD= ;AUTHENTICATOR=SNOWFLAKE_JWT;PRIV_KEY_FILE=PATH-TO-KEY-FILE;PRIV_KEY_FILE_PWD=PASSPHRASE' />
</customizations>
</connection-customization>

Save the above content as a file with .tdc as extension locally in the Datasources folder in the Tableau Repository folder. This will be applicable to when working with Tableau Desktop.

If the .tdc file will be used on Tableau Server, the following documentation is recommended.

The location of where to save the file, is depending on the operating system and Tableau Server version.

Facts & figures

About client

Testimonial

Blogs you might also like

7 Things You Should Know About NULL Values

7 Things You Should Know About NULL Values

Having troubles with NULL values? Here are 7 things you should know about them.

Data Engineering
Blog
Tableau
Snowflake 101: Loading cloud data using AWS

Snowflake 101: Loading cloud data using AWS

Let's discover how to load structured data from Cloud using AWS S3 into Snowflake.

Data Engineering
Blog
Snowflake
Loading data from local environments into Snowflake

Loading data from local environments into Snowflake

Discover how to load structured data from a computer into Snowflake.

Data Engineering
Blog
Snowflake
How to pass the SnowPro Core certification exam

How to pass the SnowPro Core certification exam

Get a hands-on personal take on the SnowPro Core certification and how you should prepare for it. We're sure you'll ace the exam!

Data Engineering
Blog
Snowflake
How to UPSERT or MERGE data with Tableau Prep’s write-back functionality

How to UPSERT or MERGE data with Tableau Prep’s write-back functionality

A demonstration of how to simply apply the straightforward concept of MERGE and UPSERT in Tableau Prep.

Data Engineering
Blog
Tableau
dbt Configuration: YAML file

dbt Configuration: YAML file

Learn the basics of configuring your YAML files for dbt the right way.

Data Engineering
Blog
dbt
Improving your Data Quality in 7 Steps

Improving your Data Quality in 7 Steps

Want to improve your data quality? Learn how to improve data quality in 7 steps here. Read the full article.

Data Engineering
Blog
Why automate your data pipelines?

Why automate your data pipelines?

Thinking of building your own data pipelines? This article explains why that's not always the best option.

Data Engineering
Blog
Fivetran
Using dbt to model GA4 raw data

Using dbt to model GA4 raw data

Learn how to leverage dbt to model GA4 raw data for in-depth analysis and insights.

Data Engineering
Blog
dbt
What is Salesforce Data 360: The Ultimate Guide

What is Salesforce Data 360: The Ultimate Guide

Discover how Salesforce Data 360 unifies customer data, enhances decision-making, and powers AI-driven innovations.

Data Engineering
Blog
Data Cloud
Snowflake vs Salesforce Data 360

Snowflake vs Salesforce Data 360

Discover how Snowflake and Salesforce Data Cloud can complement each other to create an integrated, scalable, and actionable data strategy.

Data Engineering
Blog
Data Cloud