Authorization code grant
- Last Updated: May 16, 2025
- 2 minute read
- DataDirect Connectors
- ODBC
- Snowflake 8.0
- Documentation
The authorization code grant is a commonly used authentication flow for
web and native applications. It provides secure connections by requiring multiple points of
authentication before permitting access to data. When using the authorization code flow, the
application is first redirected to the location hosting the temporary authorization code and
retrieves it. Next, after being redirected to the location specified by the Redirect URI
(RedirectURI) option, the application exchanges the authorization code,
client ID, and client secret for the access token.
To use an authorization code grant:
- Set the Authentication Method (
AuthenticationMethod) option to24. - 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 Authorization URI (
AuthURI) option to the endpoint used to obtain the authorization code from the authorization service. - Set the Client ID (
ClientID) option to specify the client ID key for your application. - Set the Client Secret (
ClientSecret) option to specify the 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 Redirect URI (
RedirectURI) option to specify the endpoint that the client is returned to after authenticating with the service. This value must match the redirect URI specified in the Snowflake OAuth security integration.
The following examples show the connection information required to establish a session using the authorization code grant.
Connection string
DRIVER=DataDirect 8.0 Snowflake;AuthenticationMethod=24;
AccountName=account_name.us-east-1;DatabaseName=MyDB;Schema=MySchema;Warehouse=MyWH;
AuthURI=https://account_name.us-east-1.snowflakecomputing.com/oauth/authorize;
ClientId=cd34efg5678h9ij87klm6543no32pqr10st987;ClientSecret=098zyx765wvu432tsr123qpo456;
RedirectUri=https://lvn.me/app_callback.html;
odbc.ini file (32-bit)
Driver=ODBCHOME/lib/ivsnowflake28.yy
...
AuthenticationMethod=24
...
AccountName=account_name.us-east-1
...
DatabaseName=MyDB
...
Schema=MySchema
...
Warehouse=MyWH
...
AuthURI=https://account_name.us-east-1.snowflakecomputing.com/oauth/authorize
...
ClientId=cd34efg5678h9ij87klm6543no32pqr10st987
...
ClientSecret=098zyx765wvu432tsr123qpo456
...
RedirectUri=https://lvn.me/app_callback.html
...