The refresh token grant is used to request a new access token or renew an expired one by exchanging the refresh token at the endpoint specified by the Token URI (TokenURI) option.

To configure the driver to use the refresh token grant for OAuth 2.0 authentication:

  • Set the Authentication Method (AuthenticationMethod) option to 24.
  • Set the Account Name (AccountName) option to specify the name of your account and the region where it is hosted. For example, account_name.us-east-1.
  • Set the Database Name (DatabaseName) option to specify the name of database to which you want to connect.
  • Set the Schema (Schema) option to specify the default schema to use for the specified database once connected. The specified schema should be an existing schema for which the specified default role has privileges.
  • Set the Warehouse (Warehouse) option to specify the virtual warehouse to use once connected. The specified warehouse should be an existing warehouse for which the specified default role has privileges.
  • Set the Client ID (ClientID) option to specify the client ID for your application.
  • Set the Client Secret (ClientSecret) option to specify client secret for your application.
    Important: The client secret is a confidential value used to authenticate the application to the server. To prevent unauthorized access, this value must be securely maintained.
  • Set the Token URI (TokenURI) option to specify the endpoint from which the driver fetches access tokens.
  • Set the Refresh Token (RefreshToken) option to specify the refresh token used to request a new access token or renew an expired one.
    Important: The refresh token is a confidential value used to authenticate to the server. To prevent unauthorized access, this value must be securely maintained.

The following examples show the connection information required to establish a session using the refresh token grant.

Connection string

DRIVER=DataDirect 8.0 Snowflake;AuthenticationMethod=24;
  AccountName=account_name.us-east-1;DatabaseName=MyDB;Schema=MySchema;Warehouse=MyWH;
  ClientId=cd34efg5678h9ij87klm6543no32pqr10st987;ClientSecret=098zyx765wvu432tsr123qpo456;
  TokenURI=https://account_name.us-east-1.snowflakecomputing.com/oauth/token-request;
  RefreshToken=abc12cd34efg5678h9ij87klm6543no32pqr10;

odbc.ini file (32-bit)

Driver=ODBCHOME/lib/ivsnowflake28.yy
...
AuthenticationMethod=24
...
AccountName=account_name.us-east-1
...
DatabaseName=MyDB
...
Schema=MySchema
...
Warehouse=MyWH
...
ClientId=cd34efg5678h9ij87klm6543no32pqr10st987
...
ClientSecret=098zyx765wvu432tsr123qpo456
...
TokenURI=https://account_name.us-east-1.snowflakecomputing.com/oauth/token-request
...
RefreshToken=abc12cd34efg5678h9ij87klm6543no32pqr10
...