Snowflake

Connecting to Snowflake

In addition to providing authentication (see below) set the following properties to connect to a Snowflake database:

  • Url: Both AWS and Azure instances are supported. For example:

    • AWS: https://myaccount.region.snowflakecomputing.com

    • Azure: https://myaccount.region.azure.snowflakecomputing.com

Account is only required if your Url does not conform to the usual syntax containing the account name at the beginning. Snowflake provides the Account name needed in this case.

Optionally, you can set Database and Schema to restrict the tables and views returned by the connector.

Authenticating to Snowflake

The provider supports Snowflake user authentication, federated authentication, and SSL client authentication. To authenticate, set User and Password, and select the authentication method in the AuthScheme property.

Authenticating with Password

Set User and Password to a Snowflake user and set AuthScheme to PASSWORD.

Authenticating with Key Pair

The provider allows you to authenticate using key pair authentication by creating a secure token with the private key defined for your user account. To connect with this method, set AuthScheme to PRIVATEKEY and set the following values:

  • User: The user account to authenticate as.

  • PrivateKey: The private key used for the user such as the path to the .pem file containing the private key.

  • PrivateKeyType: The type of key store containing the private key such as PEMKEY_FILE, PFXFILE, etc.

  • PrivateKeyPassword: The password for the specified private key.

Authenticating with Okta

Set the AuthScheme to Okta. The following connection properties are used to connect to Okta:

  • User: Set this to the Okta user.

  • Password: Set this to Okta password for the user.

  • MFAPasscode (optional): Set this to the OTP code that was sent to your device. This property should be used only when the MFA is required for OKTA sign on.

The following SSOProperties are needed to authenticate to Okta:

  • Domain: Set this to the OKTA org domain name.

  • MFAType (optional): Set this to the multi-factor type. This property should be used only when the MFA is required for OKTA sign on. This property accepts one of the following values:

    • OKTAVerify

    • Email

    • SMS

  • APIToken (optional): Set this to the API Token that the customer created from the Okta org. It should be used when authenticating a user via a trusted application or proxy that overrides OKTA client request context.

The following is an example connection string:

AuthScheme=OKTA;User=username;Password=password;Url='https://myaccount.region.snowflakecomputing.com';Warehouse=My_warehouse;SSO Properties='Domain=https://cdata-okta.okta.com';

The following is an example connection string for OKTA MFA:

AuthScheme=OKTA;User=username;Password=password;MFAPasscode=8111461;Url='https://myaccount.region.snowflakecomputing.com';Warehouse=My_warehouse;SSO Properties='Domain=https://cdata-okta.okta.com;MFAType=OktaVerify;';

Authenticating with AzureAD

Set the AuthScheme to AzureAD. The following connection properties are used to connect to AzureAD:

  • User: Set this to your AD user. When connecting, your browser will open allowing you to login to Azure AD to complete the authentication.

The following is an example connection string for AzureAD:

AuthScheme=AzureAD;Url=https://myaccount.region.snowflakecomputing.com;User=user@domain.onmicrosoft.com;

Authenticating with PingFederate

Set the AuthScheme to PingFederate. The following connection properties are used to connect to PingFederate:

  • User: Set this to your PingFederate user, the user should been added to PingFederate Data Stores. When connecting, your browser will open allowing you to login to PingFederate to complete the authentication.

The following is an example connection string for PingFederate(Assuming that Active Directory is used as a Data Store):

AuthScheme=PingFederate;Url=https://myaccount.region.snowflakecomputing.com;User=myuser@mydomain;Account=myaccount;Warehouse=mywarehouse;

Authenticating with OAuth

To authenticate with OAuth, set the AuthScheme to OAuth. You can authenticate by Creating a Custom OAuth App to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties.

Get an OAuth Access Token

After setting the following, you are ready to connect:

  • OAuthClientId: Set to the Client ID in your OAuth Integration settings.

  • OAuthClientSecret: Set to the Client Secret in OAuth your Integration settings.

  • CallbackURL: Set to the Redirect URL in your OAuth Integration settings.

  • InitiateOAuth: Set to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.

When you connect, the provider opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The provider then completes the following OAuth process:

  1. Extracts the access token from the callback URL and authenticates requests.

  2. Obtains a new access token when the old one expires.

  3. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

Configuring Access Control

If the authenticating user maps to a system-defined role, specify it in the RoleName property.

Last updated