Snowflake Cortex AI Connector Guide > Snowflake Cortex AI connections > Prerequisites
  

Prerequisites

You need the client ID and client secret to configure the Snowflake Cortex AI Connector using OAuth 2.0 authentication.
To retrieve the client ID and client secret, perform the following steps:
  1. 1Log in to your Snowflake account using https://app.snowflake.com/<organization name>/<account name>/#/homepage.
  2. 2Click Add > SQL File as shown in the following image:
  3. 3To alter the user and set the sysadmin as the default user, run the following query :
  4. alter user <username> set default_role = sysadmin;
  5. 4To create the security integration, run the following query:
  6. CREATE SECURITY INTEGRATION <integration_name>
    TYPE = OAUTH
    ENABLED = TRUE
    OAUTH_CLIENT = CUSTOM
    OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
    OAUTH_REDIRECT_URI = '<https://<your POD>/oauthcallback>'
    OAUTH_ISSUE_REFRESH_TOKENS = TRUE
    OAUTH_REFRESH_TOKEN_VALIDITY = 86400
    ;
    Note: The integration name must be in capital letters.
    For more information, see the Snowflake documentation.
  7. 5To grant all the permissions to sysadmin, run the following query:
  8. GRANT ALL ON INTEGRATION <integration_name> to sysadmin;
  9. 6To describe the security integration and retrieve the authorization URL and token request URL, run the following query:
  10. DESCRIBE SECURITY INTEGRATION <integration_name>;
    Copy the authorization URL and token request URL as shown in the following image:
  11. 7To retrieve the client credentials of the security integration, run the following query:
  12. select system$show_oauth_client_secrets('<integration_name>');