Appearance
Finding your Account URL, Account Locator, Client ID and Client Secret
Prerequisites for Snowflake Integration
WARNING
- You need to be an
ACCOUNTADMIN
for creating an OAuth application in Snowflake.
You'll now be prompted to add the Account URL, Account Locator, Client ID and Client Secret.
Finding Account URL and Account Locator
- Sign in to your Snowflake Account.
- In the left navigation bar at bottom, you will find your
Account URL
andAccount Locator
as shown below. - Copy and enter it in Truto interface.
Create your Client ID and Client Secret
- To create your Client ID and Client Secret, Go to
Worksheets
from left navigation bar. - Click on the
Add
button and selectSQL Worksheet
as shown below. - Make sure that the
Database
isSnowflake
and theSchema
isAccount_Usage
. - Now execute below commands in Worksheet to create your OAuth application.
CREATE ROLE TRUTO_ROLE;
TIP
- You can create any Role name by replacing
TRUTO_ROLE
above. But it should be replaced in all the following commands as well.
CREATE SECURITY INTEGRATION
Truto
TYPE = OAUTH
OAUTH_CLIENT = CUSTOM
OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
OAUTH_REDIRECT_URI = 'https://api.truto.one/connect/snowflake/callback'
ENABLED = TRUE
PRE_AUTHORIZED_ROLES_LIST = ( 'TRUTO_ROLE' )
OAUTH_ISSUE_REFRESH_TOKENS = TRUE
OAUTH_REFRESH_TOKEN_VALIDITY = 7776000
WARNING
OAUTH_REFRESH_TOKEN_VALIDITY
can be set to maximum value of 7776000 seconds (90 Days). After this the integration should be re-authenticated.
- If you need to raise the maximum value for Refresh Token's validity upto one year, refer to this link.
- To view
Client ID
andClient Secret
run the below command in worksheet.
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('TRUTO');
- Copy your
OAUTH_CLIENT_ID
andOAUTH_CLIENT_SECRET
and enter it in Truto interface asClient ID
andClient Secret
respectively. - Now go to
Users & Roles
from left navigation bar as shown below. - Go to
Roles
and selectTRUTO_ROLE
. - Now click on more options in
TRUTO_ROLE
and thenGrant to user
as shown below. - Select a user to grant this role and click on
Grant
. - Now click on more options in
TRUTO_ROLE
again and thenGrant role
as shown below. - Select
ACCOUNTADMIN
and click onGrant
. - Now click on name tab on the top left and then
Switch Role
and underTRUTO_ROLE
selectSet as default
for now.TIP
- It is required to complete the OAuth flow with allowed role.You can change it after OAuth flow is completed.
- After filling the data in Truto, click on
Connect
.