What you will be able to do
- Compare Snowflake OAuth with External OAuth and pick the right one
- Configure a Snowflake OAuth security integration for a custom client
- Explain how network policies, private connectivity and SSO affect Snowflake OAuth
1.Two OAuth 2.0 options: Snowflake OAuth and External OAuth
Snowflake supports OAuth 2.0 in two forms, and each one is configured as a security integration. With Snowflake OAuth, Snowflake is both the authorization server and the resource server. The user signs in, agrees to let the client use a particular role, and the client swaps the resulting authorization code for an access token and, optionally, a refresh token. With External OAuth, your own authorization server, such as Okta, Entra ID or PingFederate, issues a JWT. Snowflake checks the token, looks up the user it belongs to, and opens a session with the role from the token's scope.
| Category | Snowflake OAuth | External OAuth |
|---|---|---|
| Client application browser access | Required | Not required |
| Programmatic clients | Requires a browser | Best fit |
| Driver property | authenticator = oauth | authenticator = oauth |
| Integration syntax | create security integration type = oauth | create security integration type = external_oauth |
| OAuth flow | OAuth 2.0 code grant flow | Any flow the client can initiate with the External OAuth server |
With External OAuth, two integration properties decide which Snowflake user a token belongs to. EXTERNAL_OAUTH_TOKEN_USER_MAPPING_CLAIM names the claim in the token, and EXTERNAL_OAUTH_SNOWFLAKE_USER_MAPPING_ATTRIBUTE names the user property that claim is compared against. A token without a scope is rejected. The scope session:role-any uses the user's default role, but only when external_oauth_any_role_mode is configured on the integration. Both forms of OAuth block ACCOUNTADMIN, ORGADMIN, GLOBALORGADMIN and SECURITYADMIN by default. For either form, clients set authenticator=oauth and pass the token, and LOGIN_HISTORY records FIRST_AUTHENTICATION_FACTOR = OAUTH_ACCESS_TOKEN.
CREATE SECURITY INTEGRATION external_oauth_okta
TYPE = EXTERNAL_OAUTH
ENABLED = TRUE
EXTERNAL_OAUTH_TYPE = OKTA
EXTERNAL_OAUTH_ISSUER = '<OKTA_ISSUER>'
EXTERNAL_OAUTH_JWS_KEYS_URL = '<OKTA_JWS_KEY_ENDPOINT>'
EXTERNAL_OAUTH_AUDIENCE_LIST = ('https://<orgname>-<account_name>.snowflakecomputing.com')
EXTERNAL_OAUTH_TOKEN_USER_MAPPING_CLAIM = 'sub'
EXTERNAL_OAUTH_SNOWFLAKE_USER_MAPPING_ATTRIBUTE = 'login_name';Checkpoint 1 of 5· Check yourself
A headless ETL service must authenticate with OAuth and has no browser available. Which option fits?
Snowflake OAuth requires a browser for the code grant flow. External OAuth needs no browser and is described as the best fit for programmatic clients.
“Clients can authenticate to Snowflake without browser access, allowing ease of integration with the External OAuth server.”Source: docs.snowflake.com
Checkpoint 2 of 5· Exam question
Your company uses Okta as its identity provider. As the account administrator you must let employees sign in from the Snowflake login page with an Okta SSO button. Which approach is the MOST appropriate?
Correct answer: C — Run CREATE SECURITY INTEGRATION with TYPE = SAML2, setting SAML2_ISSUER, SAML2_SSO_URL, SAML2_PROVIDER, SAML2_X509_CERT and a login page label
- A. User RSA public keys are for key-pair (JWT) authentication of clients with their own private key, not for trusting an IdP's SAML assertions.
- B. External OAuth validates access tokens presented by clients; it does not provide a browser SSO flow or a login-page button, and no such account parameter exists.
- C. A SAML2 security integration holds the IdP issuer, SSO URL, provider and signing certificate, and the login-page label drives the SSO button, so this is the supported way to federate authentication.
- D. A SCIM integration only provisions and deprovisions users and roles from the IdP. It does not carry SAML settings and cannot enable SSO sign-in.
2.Configuring Snowflake OAuth for a custom client
Partner tools such as Tableau and Looker have their own OAUTH_CLIENT values. For an application your organization builds, use OAUTH_CLIENT = CUSTOM. A custom client also needs OAUTH_CLIENT_TYPE and OAUTH_REDIRECT_URI. Confidential clients are ones that can keep a secret, such as a service running in the cloud. Public clients are desktop or app-store applications. Clients call two endpoints: <snowflake_account_url>/oauth/authorize, which has to open in a browser, and /oauth/token-request.
CREATE SECURITY INTEGRATION oauth_kp_int
TYPE = OAUTH
ENABLED = TRUE
OAUTH_CLIENT = CUSTOM
OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
OAUTH_REDIRECT_URI = 'https://localhost.com'
OAUTH_ISSUE_REFRESH_TOKENS = TRUE
OAUTH_REFRESH_TOKEN_VALIDITY = 86400
BLOCKED_ROLES_LIST = ('SYSADMIN')
OAUTH_CLIENT_RSA_PUBLIC_KEY ='
MIIBI
...
';| Parameter | What it controls | Range / default |
|---|---|---|
| OAUTH_ACCESS_TOKEN_VALIDITY | Access-token lifetime (seconds) | 60 to 3600; default 600 |
| OAUTH_REFRESH_TOKEN_VALIDITY | Refresh-token lifetime (seconds) | 86400 to 7776000; default 7776000 for custom clients |
| OAUTH_ISSUE_REFRESH_TOKENS | Whether refresh tokens are issued | Default TRUE |
| OAUTH_ENFORCE_PKCE | Require PKCE | Default FALSE |
| PRE_AUTHORIZED_ROLES_LIST | Roles needing no explicit consent | Confidential clients only |
| OAUTH_ANY_ROLE_MODE | Switching the primary role in-session | DISABLE (default), ENABLE, ENABLE_FOR_PRIVILEGE |
The integration has two client secrets, so you can rotate them with REFRESH OAUTH_CLIENT_SECRET or OAUTH_CLIENT_SECRET_2 without an outage. A key-pair client uses OAUTH_CLIENT_RSA_PUBLIC_KEY_2 for rotation in the same way. To withdraw a user's consent, and with it the user's access tokens, run ALTER USER ... REMOVE DELEGATED AUTHORIZATIONS FROM SECURITY INTEGRATION.
Checkpoint 3 of 5· Check yourself
You need to set PRE_AUTHORIZED_ROLES_LIST on a Snowflake OAuth custom client. Which client type supports it?
Pre-authorized roles are supported only for confidential clients, meaning clients that can keep a secret.
“This parameter is supported for confidential clients only.”Source: docs.snowflake.com
Checkpoint 4 of 5· Exam question
A data engineering team converts an existing ETL account to TYPE = SERVICE with ALTER USER. Select TWO statements that are true for this user after the change.(Select 2)
Correct answers: A, D — The user can no longer sign in to Snowsight, because SERVICE users are limited to programmatic access through drivers and APIs; Password and MFA sign-in are unavailable to the user, so clients must use key-pair authentication, a programmatic access token or OAuth
- A. Correct. SERVICE users are blocked from interactive sign-in through the Snowflake web interface and are meant for programmatic clients.
- B. Incorrect. TYPE can be changed with ALTER USER SET TYPE, so existing users can be migrated without re-creation.
- C. Incorrect. Password authentication is not supported for SERVICE users, so the old password does not act as a fallback.
- D. Correct. SERVICE users are designed for non-interactive workloads and cannot authenticate with a password or enroll in MFA.
- E. Incorrect. SERVICE users are exempt from MFA enrollment. Enrollment requirements apply to PERSON users that sign in with a password.
3.How network policies, private connectivity and SSO affect Snowflake OAuth
Network policies. A NETWORK_POLICY set on a Snowflake OAuth integration controls two things: client requests for tokens, and the queries the client then runs against Snowflake as the resource server. The user's browser sign-in follows the user-level network policy, or the account-level policy if the user has none. The built-in SNOWFLAKE$LOCAL_APPLICATION integration is an exception: for its token requests, the user policy is checked first, then the integration policy, then the account policy. Among partner applications, only Looker supports network policies. An External OAuth integration can't have its own network policy. If you need a policy specific to OAuth, use Snowflake OAuth.
CREATE SECURITY INTEGRATION td_oauth_int2
TYPE = oauth
ENABLED = true
OAUTH_CLIENT = tableau_desktop
OAUTH_REFRESH_TOKEN_VALIDITY = 36000
BLOCKED_ROLES_LIST = ('SYSADMIN')
NETWORK_POLICY = 'allow_private_ip_only';Private connectivity. External OAuth works over private connectivity. With Snowflake OAuth it depends on the client. Tableau Cloud connecting over private connectivity has to use OAUTH_CLIENT = CUSTOM. Looker can't use private connectivity at all, because Snowflake OAuth with Looker needs the public internet. Setting USE_PRIVATELINK_FOR_AUTHORIZATION_ENDPOINT = TRUE sends the user's sign-in step over private connectivity, but traffic between the client and Snowflake still goes over the public internet. Hosted SaaS clients therefore have to use the public account URL for token requests. To find the private-connectivity URL, call SYSTEM$GET_PRIVATELINK_CONFIG.
Federated authentication. When the Snowflake OAuth authorization screen appears, the user can sign in through SSO, so the IdP's authentication methods (including its MFA) apply. Under External OAuth, the authorization server enforces authentication. Users who only ever connect through External OAuth need no Snowflake password.
Checkpoint 5 of 5· Check yourself
Tableau Cloud must reach Snowflake over private connectivity with Snowflake OAuth. How should the integration be created?
For Tableau Cloud over private connectivity, the documentation says to create a custom-client integration instead of using TABLEAU_SERVER.
“If Tableau Cloud is connecting to Snowflake using private connectivity to the Snowflake service, be sure to specify OAUTH_CLIENT = CUSTOM instead.”Source: docs.snowflake.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.You can attach a NETWORK_POLICY directly to an External OAuth security integration.Why is that wrong?
An External OAuth integration can't have a network policy of its own. Only account-wide policies apply. For an OAuth-specific policy, use Snowflake OAuth.
Covered in How network policies, private connectivity and SSO affect Snowflake OAuth
2.USE_PRIVATELINK_FOR_AUTHORIZATION_ENDPOINT = TRUE keeps the whole OAuth exchange off the public internet.Why is that wrong?
Only the user's sign-in step goes over private connectivity. Traffic between Snowflake and the client, including the initial request to the authorization endpoint, still goes over the public internet.
Covered in How network policies, private connectivity and SSO affect Snowflake OAuth
Practise it for real
Create a Snowflake OAuth custom-client integration and inspect and manage it
1.As a role with CREATE INTEGRATION (or ACCOUNTADMIN), run the oauth_kp_int CREATE SECURITY INTEGRATION statement from this page, using your client's real public key.
Why: Registers your custom client with Snowflake as the authorization server.
You should see: The integration is created successfully.
2.Run DESC SECURITY INTEGRATION oauth_kp_int.
Why: Shows the endpoints and settings the client must use.
You should see: OAUTH_ALLOWED_AUTHORIZATION_ENDPOINTS and OAUTH_ALLOWED_TOKEN_ENDPOINTS list your /oauth/authorize and /oauth/token-request URLs.
3.After a user authorizes the client, run SHOW DELEGATED AUTHORIZATIONS TO SECURITY INTEGRATION oauth_kp_int.
Why: Confirms which users have given consent and for which role.
You should see: One row per consenting user, showing role_name and integration_status ENABLED.
4.As SECURITYADMIN, run ALTER USER <username> REMOVE DELEGATED AUTHORIZATIONS FROM SECURITY INTEGRATION oauth_kp_int.
Why: Withdrawing consent also revokes the access tokens tied to the integration.
You should see: The user's row is gone from SHOW DELEGATED AUTHORIZATIONS, and the client has to go through authorization again.
Stuck? Get a nudge
If DESC shows unexpected endpoints, check that OAUTH_REDIRECT_URI exactly matches the redirect_uri your client sends, with query parameters removed.
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.snowflake.com/en/user-guide/oauth-introOfficial docs
“Snowflake supports the OAuth 2.0 protocol for authentication and authorization using one of the options below:”
↩︎ Two OAuth 2.0 options: Snowflake OAuth and External OAuth“Currently, combining Snowflake OAuth and Looker requires access to the public Internet.”
↩︎ How network policies, private connectivity and SSO affect Snowflake OAuth - 2.
“Note that if you do not define a scope, the connection attempt to Snowflake will fail.”
↩︎ Two OAuth 2.0 options: Snowflake OAuth and External OAuth“no additional authentication configuration (that is, set a password) is necessary in Snowflake”
↩︎ How network policies, private connectivity and SSO affect Snowflake OAuth“Clients can authenticate to Snowflake without browser access, allowing ease of integration with the External OAuth server.”
↩︎ Checkpoint - 3.
“By default, Snowflake prevents the ACCOUNTADMIN, ORGADMIN, GLOBALORGADMIN, and SECURITYADMIN roles from authenticating.”
↩︎ Two OAuth 2.0 options: Snowflake OAuth and External OAuth“When the user authenticates by using a browser, the network traffic is restricted by a network policy associated with the user.”
↩︎ How network policies, private connectivity and SSO affect Snowflake OAuth“does not affect network traffic between the user and Snowflake as the authorization server”
↩︎ Prediction - 4.https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-oauth-snowflakeOfficial docs
“Confidential clients can store a secret.”
↩︎ Configuring Snowflake OAuth for a custom client“Interactions between Snowflake and the client, including the initial request to the authorization endpoint, still happen over the public internet.”
↩︎ Exam trap 2“If Tableau Cloud is connecting to Snowflake using private connectivity to the Snowflake service, be sure to specify OAUTH_CLIENT = CUSTOM instead.”
↩︎ Checkpoint - 5.
“The default is 600 seconds (10 minutes).”
↩︎ Configuring Snowflake OAuth for a custom client - 6.https://docs.snowflake.com/en/sql-reference/sql/alter-security-integration-oauth-snowflakeOfficial docs
“Custom client86400 (1 day)7776000 (90 days)7776000 (90 days)”
↩︎ Configuring Snowflake OAuth for a custom client“Snowflake provides two client secrets (OAUTH_CLIENT_SECRET and OAUTH_CLIENT_SECRET_2) for uninterrupted rotation”
↩︎ Configuring Snowflake OAuth for a custom client“This parameter is supported for confidential clients only.”
↩︎ Checkpoint - 7.
“Snowflake supports network policies for Looker, but not other partner applications.”
↩︎ How network policies, private connectivity and SSO affect Snowflake OAuth - 8.
“User can authorize access with single sign-on (SSO), which allows them to use the secure authentication methods of a third-party IdP.”
↩︎ How network policies, private connectivity and SSO affect Snowflake OAuth
Also cited
“Currently, network policies cannot be added to your External OAuth security integration.”
↩︎ Exam trap 1