Mode Help
Connect your database
OAuth Support
Mode supports OAuth authentication for select databases. With OAuth, each Mode user signs in to the database with their own credentials, and queries run with that user's database permissions. Mode does not store a shared database username or password for the connection.
Use OAuth when you want:
- Row and object level access in your database to apply to every query a user runs in Mode
- Query activity in your database to be attributed to the individual Mode user
- To avoid managing a shared service account password or key
The following databases support OAuth in Mode:
| Database | Supported OAuth Methods |
|---|---|
| Snowflake | OAuth, OAuth with PKCE |
Snowflake
Mode supports two OAuth methods for Snowflake:
- OAuth: uses an OAuth client ID and client secret
- OAuth with PKCE: uses an OAuth client ID only. No client secret is required
Prerequisites
Before you connect Snowflake to Mode with OAuth, make sure you have:
- Workspace admin access in Mode
- An OAuth client ID from your Snowflake admin, plus a client secret if you are using OAuth without PKCE
- A Snowflake JDBC driver version supported by Mode. We recommend 3.26.0.
Connect Snowflake to Mode using OAuth
- Click your name in the upper left corner of Mode and select Workspace Settings.
- Under Data, click Connections, then click Connect a database.
- Select Snowflake from the list of databases.
- For Authentication method, select OAuth or OAuth with PKCE.
- Enter the connection details:
| Field | Description |
|---|---|
| Display name | The name users see for this connection in Mode |
| Description | Optional. A short description of the connection |
| Account URL / Host | Your Snowflake account URL, for example abc12345.us-east-1.snowflakecomputing.com |
| Account identifier | Your Snowflake account identifier, for example abc12345 |
| Warehouse | The default warehouse for queries on this connection |
| Database | The default database for this connection |
| Role | Optional. The default role. If left blank, each user's default Snowflake role is used |
| OAuth client ID | The OAuth client ID provided by your Snowflake admin |
| OAuth client secret | OAuth only. The OAuth client secret provided by your Snowflake admin. Not shown for OAuth with PKCE |
| JDBC driver | The Snowflake JDBC driver version. We recommend 3.26.0. |
- Click Connect. Mode redirects you to Snowflake.
- Sign in to Snowflake and click Allow to grant Mode access.
Once authorized, you return to Mode and the connection is ready to use.
Authenticating as a user
Every Mode user must authorize the connection with their own Snowflake account before they can run queries against it.
- Open a report or create a new query, then click the name of the Snowflake OAuth connection in the data source selector.
- When prompted, click Continue to Snowflake.
- Enter your Snowflake username and password, or click Sign in using SSO.
- Once you return to Mode, you can run queries as usual.
After the token expires, or if it is revoked in Snowflake, Mode prompts the user to re-authenticate the next time they run a query.
Scheduled runs
Scheduled report runs use the OAuth token of the report owner. If the owner's token expires or is revoked, scheduled runs fail until the owner re-authenticates. Ask report owners to re-authenticate before their token expires to avoid missed runs.
Snowflake OAuth FAQs
Should I use OAuth or OAuth with PKCE?
Use the method that matches the OAuth client your Snowflake admin set up. If your admin gave you a client ID and a client secret, use OAuth. If they gave you a client ID only, use OAuth with PKCE.
Can I switch an existing Snowflake connection from password or key pair to OAuth?
We recommend creating a new connection with OAuth and moving reports to it. Each user then authorizes the new connection with their own Snowflake account.
Does schema refresh work with OAuth?
Yes. Schema refresh retrieves all databases the authenticated user has access to in Snowflake, and is not limited to the default database and warehouse on the connection.
Was this article helpful?