Intended Audience: Snowflake administrators with ACCOUNTADMIN role or users with CREATE INTEGRATION privilege. This setup is performed once and enables OAuth authentication for your organizationâs Snowflake connection.
What This Guide Covers
This documentation will help you:- Create a Snowflake OAuth Integration - Register Gumloop as a custom OAuth client in Snowflake
- Retrieve OAuth Credentials - Get the Client ID and Client Secret needed for Gumloop
- Configure Gumloop (Administrator) - Add the Snowflake OAuth Config to your workspace
- User Authentication - Connect individual user accounts with proper scopes
Overview
Snowflake OAuth integration enables secure authentication between Gumloop and your Snowflake account. Instead of sharing static credentials, OAuth allows users to authorize Gumloop to access Snowflake on their behalf with automatic token refresh and better security controls.Why Use Snowflake OAuth with Gumloop?
Enhanced Security
OAuth tokens are temporary and can be revoked, reducing the risk of credential exposure
Automatic Token Refresh
Refresh tokens keep your connection active without manual re-authentication
Centralized Control
Manage access and permissions directly in Snowflake
Audit Trail
Track OAuth authentication events in Snowflakeâs audit logs
Prerequisites
Before you begin, ensure you have:- Snowflake Account Access - You need the ACCOUNTADMIN role or a role with CREATE INTEGRATION privilege
- Snowflake Account URL - Your Snowflake account URL (e.g.,
https://myorg-account123.snowflakecomputing.com) - Gumloop Workspace - An active Gumloop workspace where youâll add the credentials
Step 1: Create the Snowflake OAuth Integration
Youâll run SQL commands in Snowflake to create a custom OAuth integration for Gumloop.1.1 Connect to Snowflake
- Log in to your Snowflake account
- Open a new SQL worksheet
- Ensure youâre using a role with sufficient privileges:
If you donât have the ACCOUNTADMIN role, ask your Snowflake administrator to either grant you this role temporarily or execute these commands on your behalf.
1.2 Create the OAuth Integration
Copy and execute the following SQL command to create the OAuth integration:Understanding the Configuration Parameters
Understanding the Configuration Parameters
- TYPE = OAUTH - Specifies this is an OAuth integration
- ENABLED = TRUE - Activates the integration immediately
- OAUTH_CLIENT = CUSTOM - Indicates this is a custom OAuth client (not a pre-built partner integration)
- OAUTH_CLIENT_TYPE = âCONFIDENTIALâ - Marks this as a confidential client that can securely store secrets
- OAUTH_REDIRECT_URI - The Gumloop callback URL where users are redirected after authentication
- OAUTH_ISSUE_REFRESH_TOKENS = TRUE - Enables automatic token refresh for persistent connections
- OAUTH_REFRESH_TOKEN_VALIDITY = 7776000 - Sets refresh token validity to 90 days (7,776,000 seconds)
If youâre manually setting up an allowed scope list using Refer to the Snowflake OAuth documentation for scope configuration details.
OAUTH_ALLOWED_SCOPES, ensure you include refresh_token and any specific roles required. For example:1.3 Verify the Integration
Confirm the integration was created successfully:GUMLOOP in the results.
1.4 View Integration Details
To see all configuration details:Step 2: Retrieve OAuth Credentials
Now you need to get the Client ID and Client Secret that Gumloop will use to authenticate.2.1 Get Client Credentials
Execute the following command:2.2 Save the Credentials
Copy and save the following values from the JSON response:- OAUTH_CLIENT_ID - Youâll need this for Gumloop
- OAUTH_CLIENT_SECRET - Youâll need this for Gumloop
Step 3: Configure Gumloop (Administrator Setup)
Now that you have your Snowflake OAuth credentials, youâll add them to Gumloop as an administrator.3.1 Add Snowflake OAuth Config to Gumloop
- Navigate to Gumloop Credentials Page
- Search for âSnowflake OAuth Configâ in the credentials list
- Click Add Credential
- Enter the following information:
- Client ID: The
OAUTH_CLIENT_IDfrom Step 2.1 - Client Secret: The
OAUTH_CLIENT_SECRETfrom Step 2.1
- Client ID: The
- Save the configuration
Step 4: User Authentication
Once the administrator has completed Step 3, individual users can connect their Snowflake accounts.4.1 Connect Your Snowflake Account
- Navigate to Gumloop Credentials Page
- Click Add Credential
- Select Snowflake from the list of integrations
- Choose OAuth as the authentication method
- Select Snowflake OAuth Config (the configuration added by your administrator)
- Enter the following information:
- Workspace ID: Your Snowflake account identifier (e.g.,
myorg-account123) - Scopes: Space-separated list of OAuth scopes (see warning below)
- Workspace ID: Your Snowflake account identifier (e.g.,
4.2 Authorize the Connection
After entering your information:- Click Connect or Authorize
- Youâll be redirected to Snowflakeâs authorization page
- Log in with your Snowflake credentials
- Review the requested permissions and role
- Click Authorize to grant Gumloop access
- Youâll be redirected back to Gumloop with a successful connection
4.3 Verify Your Connection
To confirm your OAuth connection is working correctly:- Go to Gumloop Credentials Page
- Search for Snowflake
- If the connection is successful, you should see your Snowflake username displayed instead of âSnowflake Accountâ

Blocking Specific Roles
Snowflake automatically blocks certain administrative roles from being used with OAuth for security reasons. These blocked roles include:- ACCOUNTADMIN
- ORGADMIN
- SECURITYADMIN
- GLOBALORGADMIN
Adding Additional Blocked Roles
To block additional custom roles from being used with OAuth:If users need to access Snowflake with OAuth using a role thatâs currently blocked, they have two options:
- Request removal from the blocked roles list (requires Snowflake Support approval)
- Switch to a different, non-blocked role that has the necessary permissions
Troubleshooting
âInvalid Clientâ Error
Problem: Getting an âinvalid_clientâ error when connecting Solution:- Verify the Client ID and Client Secret are correct in the Snowflake OAuth Config
- Check that the integration is enabled:
DESC SECURITY INTEGRATION GUMLOOP; - Ensure the redirect URI matches exactly:
https://api.gumloop.com/auth/callback
Most Operations Are Failing
Problem: Connected successfully but Snowflake operations return permission errors Solution: This usually means scopes are not configured correctly. Ensure you included both:refresh_tokenscope for maintaining the connectionsession:role:YOUR_ROLE_NAMEscope for accessing Snowflake resources
refresh_token session:role:PUBLIC
Role Access Issues
Problem: Users canât access certain Snowflake resources or specific role Solution:- Verify the role name in your scope is spelled correctly and in uppercase
- Check if the desired role is blocked:
DESC SECURITY INTEGRATION GUMLOOP; - Ensure the user has been granted the role in Snowflake:
SHOW GRANTS TO USER your_username; - If using an administrative role (ACCOUNTADMIN, SECURITYADMIN, etc.), these are blocked by default
Username Not Showing in Gumloop
Problem: Still seeing âSnowflake Accountâ instead of username in credentials page Solution:- The OAuth authorization may not have completed successfully
- Try removing the credential and re-connecting
- Verify scopes are configured correctly with both
refresh_tokenand a valid role - Check Snowflake audit logs to confirm the OAuth authorization was successful
Tokens Expiring Too Quickly
Problem: Users need to re-authenticate frequently Solution: Increase the refresh token validity in Snowflake:Security Best Practices
Regular Credential Rotation
Periodically rotate your OAuth client secrets to maintain security
Principle of Least Privilege
Grant users only the minimum Snowflake roles needed for their work
Monitor OAuth Activity
Regularly review OAuth token usage in Snowflake audit logs
Network Policies
Configure Snowflake network policies to restrict OAuth access by IP
For comprehensive security guidance and advanced configuration options, refer to the official Snowflake OAuth documentation.
Additional Resources
- Snowflake OAuth Custom Clients Documentation
- Snowflake OAuth Error Codes
- Snowflake Network Policies
- Gumloop Credentials Guide
Need Help?
If you encounter issues not covered in this guide:- Check the Snowflake OAuth documentation for detailed technical information
- Contact your Snowflake administrator for account-specific issues
- Reach out to Gumloop Support for integration assistance
