The Snowflake connector is available exclusively on the Enterprise plan.
- Snowflake Account Admin — Creates the OAuth integration in Snowflake
- Replit Workspace Admin — Configures the connector in Replit
- Builder — Signs in and starts building
Create the OAuth integration in Snowflake
The Snowflake Account Admin creates an OAuth Security Integration that allows Replit to authenticate with Snowflake.Prerequisites
ACCOUNTADMINrole in Snowflake- Access to run SQL in Snowflake worksheets
Run the setup script
1
Log in to Snowflake
Open your Snowflake account and make sure you are using the
ACCOUNTADMIN role. You can verify this in the role dropdown in the top-right corner.2
Open a SQL worksheet
Click Worksheets in the left sidebar and create a new worksheet.
3
Run the OAuth integration script
Copy and paste the following SQL script and run it:
Create OAuth integration
Setting
BLOCKED_ROLES_LIST = () ensures no roles are blocked from using the integration. Without this, you may get “invalid consent request” or “role blocked” errors when connecting.4
Retrieve your OAuth credentials
Run this query to get the Client ID and Client Secret:Copy the Client ID and Client Secret from the output. You need these for the next step.
Get OAuth credentials
Allow connector traffic when network restrictions apply
If your Snowflake account restricts access by IP address, ask your Snowflake admin to check the network policy forREPLIT_OAUTH.
Browser sign-in and connector requests follow different network policies:
- Browser sign-in uses the Snowflake user’s network policy, or the account policy if no user policy exists.
- Connector token requests and queries use the OAuth security integration’s network policy, or the account policy if no integration policy exists.
YOUR_CONNECTOR_NETWORK_POLICY with its name:
Set OAuth network policy
Configure the connector in Replit
The Replit Workspace Admin adds the Snowflake credentials to Replit. Once configured, anyone in the organization can sign in.This step requires an Enterprise plan with admin access.
1
Open Integrations
Select your organization’s workspace, then go to Integrations in Settings.
2
Add the Snowflake connector
Click Add New Connector and select Snowflake.
3
Enter credentials
Provide the Client ID and Client Secret from the previous step.
4
Set the scope
Set the connector scope to
refresh_token.5
Save
Click Save to enable the connector.
Sign in to Snowflake
Any organization member with access to the connector can sign in. Sign in from the Integrations page first to verify the connection before using it with Agent.1
Find the Snowflake connector
Go to Integrations in Replit. Under Connectors, find Snowflake.
2
Click Sign In
Click Sign In on the Snowflake connector.
3
Enter your Snowflake Account ID
The OAuth prompt asks for your Snowflake Account ID.To find your Account ID, look at your Snowflake URL:Take the two parts after
app.snowflake.com/ and join them with a hyphen:The URL uses a
/ between the two parts, but the Account ID uses a - instead.4
Authenticate
Snowflake redirects you to the login page. Enter your Snowflake credentials to complete the OAuth flow.
Start building with your Snowflake data
After connecting, you can use the Snowflake connector with Agent in two ways:- Slash command — Type
/snowflakein the prompt to use the connector - Natural language — Ask Agent to use your Snowflake data directly
Troubleshooting
Invalid consent request or role blocked error
Invalid consent request or role blocked error
Your Snowflake integration may have roles blocked by default.Verify your integration was created with If the error persists, check that your default role is not blocked:
BLOCKED_ROLES_LIST = (). If you already created it without this setting, run:Fix blocked roles
Set default role
404 error on authentication
404 error on authentication
Verify that the redirect URI in your Snowflake integration is exactly:Any mismatch causes a 404 during the OAuth flow.
Invalid scope error
Invalid scope error
Make sure the connector scope in Replit is set to
refresh_token only. Remove any other scopes like session:role-any or session:role:PUBLIC.Failed to connect error
Failed to connect error
If browser sign-in succeeds but the connector fails to connect, network restrictions may still block the connector’s requests. Ask your Snowflake admin to check the policy on
REPLIT_OAUTH, not only the user or account policy. Follow Allow connector traffic when network restrictions apply, then try signing in to the connector again.Verify that the Client ID and Client Secret in Replit match what Snowflake generated. Re-check by running:Verify credentials
Related documentation
- Warehouse connectors overview — Overview of all supported warehouse connectors
- Connect Databricks — Step-by-step Databricks setup
- Managing your connectors — Connector management and configuration
- Snowflake — Configure OAuth for custom clients — Snowflake’s OAuth documentation