Configure Snowflake for UserLock Single Sign-On (SSO)
Enable Snowflake Single Sign-On (SSO) with UserLock to centralize authentication, enforce access policies, and simplify user access to Snowflake.
This guide explains how to integrate Snowflake with UserLock Single Sign-On (SSO) using the SAML 2.0 protocol.
Once configured, Snowflake logins are authenticated by UserLock against Active Directory, enabling administrators to enforce UserLock access policies (MFA, time, machine, or location restrictions) on Snowflake sessions.
Unlike most Service Providers, Snowflake is not configured through a graphical form: the SAML settings are declared with a SQL command that creates a security integration.
🚩️ Before starting:
You need a Snowflake account and a role with the ACCOUNTADMIN privilege.
You need to know the email domain used by your Snowflake users, for example
contoso.com.UserLock SSO must already be installed and configured, and reachable from the browsers of your Snowflake users over HTTPS with a valid SSL certificate.
Each user who will sign in through SSO must already exist in Snowflake. Snowflake does not create an account from a SAML assertion.
⚠️ Important
Keep at least one ACCOUNTADMIN account with a Snowflake password that you know, and protect it with Snowflake MFA. By default, a Snowflake user configured for SAML can still authenticate with a Snowflake password, which is your only way back in if UserLock SSO becomes unreachable.
Do not apply a SAML-only authentication policy until the complete sign-in flow has been tested.
Open the Snowflake console at
https://app.snowflake.com.Click +, select SQL File, then run:
sqlSELECT CURRENT_ORGANIZATION_NAME() AS ORG_NAME, CURRENT_ACCOUNT_NAME() AS ACCOUNT_NAME;In the UserLock console, go to ⚙️ Server settings ▸ Single Sign-On.
In the application list, select Snowflake.
Complete the Snowflake profile:
Settings
Values
Application Domain
The account identifier only, in the form
<org_name>-<account_name>. For examplecontoso-ab12345Email domain
Domain of the email addresses used to sign in. For example
contoso.comCertificate
Leave empty unless you require Snowflake to sign its SAML requests
Save the profile
Your UserLock SSO URL is displayed in ⚙️ Server settings ▸ Single Sign-On. In this guide, <SSO_address> is that URL without the protocol. For https://sso.contoso.com, the SSO address is sso.contoso.com. If the URL uses a custom port, include it everywhere: https://sso.contoso.com:450 gives sso.contoso.com:450.
Retrieve the UserLock signing certificate first:
In the UserLock console, go to ⚙️ Server settings ▸ Single Sign-On.
Click Download ▸ SAML certificate.
Open the certificate in a text editor and copy the Base64 value.
⚠️ Important
Snowflake expects the Base64 body only. Remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines, and remove all line breaks so that the value is a single continuous string.
Then run the following command as ACCOUNTADMIN, adapting the values to your environment:
CREATE SECURITY INTEGRATION userlock_sso
TYPE = SAML2
ENABLED = TRUE
SAML2_PROVIDER = 'Custom'
SAML2_ISSUER = 'https://sso.contoso.com'
SAML2_SSO_URL = 'https://sso.contoso.com/saml/sso'
SAML2_X509_CERT = 'MIICqzCCAZOgAwIBAgIIVS4f...wNxVfdfiKl7MeJ4XyJx'
SAML2_SNOWFLAKE_ISSUER_URL = 'https://contoso-ab12345.snowflakecomputing.com'
SAML2_SNOWFLAKE_ACS_URL = 'https://contoso-ab12345.snowflakecomputing.com/fed/login'
SAML2_REQUESTED_NAMEID_FORMAT = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'
SAML2_ENABLE_SP_INITIATED = TRUE
SAML2_SP_INITIATED_LOGIN_PAGE_LABEL = 'UserLock SSO';The five values to substitute:
Field | Value |
|---|---|
|
|
|
|
| The Base64 value copied above |
|
|
|
|
⚠️ Important
Keep SAML2_ENABLE_SP_INITIATED = TRUE. UserLock SSO only supports service-provider-initiated authentication, so users must start the sign-in from Snowflake.
UserLock sends the user's email address as the SAML NameID, and Snowflake matches that value against the user's LOGIN_NAME. A Snowflake user whose LOGIN_NAME does not match the email address sent by UserLock is rejected.
For each user who will sign in through SSO, set LOGIN_NAME to the email address held in Active Directory, in the domain configured in the UserLock profile:
CREATE USER jdoe
LOGIN_NAME = 'jdoe@contoso.com'
EMAIL = 'jdoe@contoso.com'
DISPLAY_NAME = 'Jane Doe'
FIRST_NAME = 'Jane'
LAST_NAME = 'Doe'
MUST_CHANGE_PASSWORD = FALSE
DEFAULT_ROLE = PUBLIC;To update an existing user, run ALTER USER jdoe SET LOGIN_NAME = 'jdoe@contoso.com';
Keep your existing Snowflake administrator session open while testing.
Open an incognito or private browser window.
Open your account URL, for example
https://contoso-ab12345.snowflakecomputing.com.Click UserLock SSO on the login page.
Authenticate through UserLock with an Active Directory account whose email address is in the configured Email domain and matches the
LOGIN_NAMEof an existing Snowflake user.Confirm that the user reaches the Snowflake console with the expected role.
Snowflake password authentication remains available by default, which is what lets an administrator sign in when UserLock SSO is unreachable. Confirm the following before you enforce SSO:
At least one ACCOUNTADMIN account has a Snowflake password that you know.
That account is protected by Snowflake MFA.
The account is exempt from any SAML-only authentication policy you apply, or the policy is applied to a role rather than to the whole account.
Creating the security integration does not disable password sign-in. Some environments require users to authenticate only through SSO. Snowflake enforces this with an authentication policy.
⚠️ Important
A SAML-only policy applied at account level blocks every password sign-in, including yours. If SSO breaks afterwards, the only way back is to run ALTER ACCOUNT UNSET AUTHENTICATION POLICY; from a session or role that the policy does not cover.
Applying the policy to a single role first is a safer first step.
Confirm that SSO works end to end for the users concerned.
Create the policy:
sqlCREATE AUTHENTICATION POLICY saml_only_policy AUTHENTICATION_METHODS = ('SAML');Apply it:
sqlALTER ACCOUNT SET AUTHENTICATION POLICY saml_only_policy;
When you renew the UserLock SAML certificate, update Snowflake during Step 2. Update SaaS applications of the Renew the SAML certificate procedure.
In the UserLock console, go to ⚙️ Server settings ▸ Single Sign-On and click Download ▸ SAML certificate.
Open the certificate in a text editor and copy the Base64 value, without the header and footer lines and without line breaks.
Update the integration:
sqlALTER SECURITY INTEGRATION userlock_sso SET SAML2_X509_CERT = 'MIICqzCCAZOgAwIBAgIIVS4f...wNxVfdfiKl7MeJ4XyJx';Test a sign-in and confirm that authentication succeeds.
For common issues, see Troubleshooting SSO. If the problem persists, contact IS Decisions Support.
The NameID sent by UserLock matches no Snowflake user. Either the user has not been created in Snowflake, or the LOGIN_NAME does not match the email address held in Active Directory. See Match the Snowflake users to Active Directory.
UserLock found no email address on the authenticating Active Directory account matching the Email domain configured in the Snowflake profile. Check the mail and proxyAddresses attributes of the user, and the Email domain value in the profile. UserLock also sends this error by email to the SSO administrator.
SAML2_SNOWFLAKE_ISSUER_URL or SAML2_SNOWFLAKE_ACS_URL does not match your account URL exactly. Run the query in Step 1 again to confirm the account identifier, then correct the integration with ALTER SECURITY INTEGRATION.
SAML2_X509_CERT no longer matches the certificate used by UserLock to sign the SAML response, usually after a certificate renewal. See Update the SAML certificate in Snowflake. Confirm also that the value contains no header line, footer line, or line break.
SAML2_ENABLE_SP_INITIATED is not set to TRUE. Users cannot reach UserLock without it, since UserLock SSO does not support identity-provider-initiated authentication.
ALTER SECURITY INTEGRATION userlock_sso SET SAML2_ENABLE_SP_INITIATED = TRUE;Sign in with the recovery administrator's Snowflake password, then disable the integration:
ALTER SECURITY INTEGRATION userlock_sso SET ENABLED = FALSE;If a SAML-only authentication policy is applied, remove it first:
ALTER ACCOUNT UNSET AUTHENTICATION POLICY;Re-enable the integration once UserLock SSO is reachable again.
You can extend the security of SSO sessions by applying UserLock access policies in addition to authentication.
Apply MFA on SaaS connections to require stronger authentication.
Hour restrictions: define when users are allowed to connect.
Geolocation rules: enforce access policies based on user location.
Session limits: allow or deny SaaS logins entirely for specific users.