ODBC Driver for Snowflake

Obtaining Credentials for OAuth 2.0 Authentication - ODBC Driver for Snowflake

Obtaining Credentials for OAuth 2.0 Authentication

To use OAuth 2.0 authentication with Snowflake, create a security integration and obtain the client ID and client secret required for the connection.

Create an OAuth Security Integration in Snowflake

  1. In Snowflake, open a worksheet.
  2. Run the following script. Replace <your_integration> with a name for the security integration.
    USE ROLE ACCOUNTADMIN;
    CREATE SECURITY INTEGRATION <your_integration>
    TYPE = OAUTH
    ENABLED = TRUE
    OAUTH_CLIENT = CUSTOM
    OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
    OAUTH_REDIRECT_URI = 'http://localhost:58088'
    OAUTH_ISSUE_REFRESH_TOKENS = TRUE
    OAUTH_REFRESH_TOKEN_VALIDITY = 7776000;
    

    OAUTH_REFRESH_TOKEN_VALIDITY specifies the refresh token validity period in seconds. The value can range from 86400 (1 day) to 7776000 (90 days). The default value is 7776000 (90 days).

View the OAuth Security Integration

To verify that the security integration was created successfully, run the following script:

USE ROLE ACCOUNTADMIN;
DESC SECURITY INTEGRATION <your_integration>;

Get the Client ID and Client Secret

  1. Run the following script to obtain the client ID and client secret for the security integration:
    USE ROLE ACCOUNTADMIN;
    SELECT system$show_oauth_client_secrets('<your_integration>');
    
  2. Copy the returned client ID and client secret.
  3. In the driver configuration dialog, enter the values in the ClientId and Client Secret fields.
  4. Click Sign in to Snowflake to obtain the token.

See Also

Connection String Parameters

Windows DSN Configuration

Obtaining Credentials for Key Pair Authentication

© 2015-2026 Devart. All Rights Reserved. Request Support ODBC Forum Provide Feedback