Snowflake OAuth is Snowflake's built-in OAuth service. When you create a Snowflake OAuth security integration, you effectively register your client application with Snowflake. After you create the security integration, you can obtain the client information (client ID, client secret, authorization endpoint, and token endpoint) required for configuring the driver.

Take the following steps to create a Snowflake security integration and obtain required client information.

Note: The Snowflake user must have either the ACCOUNTADMIN role or the global CREATE INTEGRATION privilege to execute the create security integration command.
  1. Log in to Snowflake.
  2. Open Worksheets or select the scheme you are working with.
    Note: Administrators may check to see whether the SYSADMIN role has the required privileges for the warehouse by navigating to Admin > Warehouses > warehouse_name > Edit > Privileges.
  3. Run the following command to create the security integration.
    Note: For details on parameters, refer to CREATE SECURITY INTEGRATION (Snowflake OAuth) in the Snowflake documentation.
    create security integration integration_name
    	type = oauth
    	enabled = true
    	oauth_client = custom
    	oauth_client_type = confidential
    	oauth_redirect_uri =redirect_uri
    	oauth_issue_refresh_tokens = true
    	oauth_refresh_token_validity=7776000;

    where:

    integration_name

    is the name of the security integration.

    redirect_uri

    is the client URI. The web browser is redirected to this URI after authorization. For example, to test, you might use http://localhost.

  4. Run the following describe command to obtain the client ID, authorization URI, and token URI.
    describe security integration integration_name;
  5. Run the following select command to obtain the client secret.
    select SYSTEM$SHOW_OAUTH_CLIENT_SECRETS(integration_name);
    Note: Two client secrets will be returned. Either may be used to configure the driver.

Results

You have created a Snowflake OAuth security integration.

What's next

If you are using the client credentials grant or the authorization code grant, proceed to the corresponding topic for guidance on configuring the driver.

If you are using the access token flow or refresh token grant, see Obtaining access and refresh tokens using the Configuration Manager.