> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Snowflake

Snowflake offers a cloud-based data storage and analytics service (see <https://www.snowflake.com/>). You can protect access to Snowflake by integrating Snowflake with Identity as a Service. Once integrated, users can use single sign-on to log in to their Snowflake account through Identity as a Service.

note

This integration was tested using Identity as a Service version 5.13 and Snowflake version 4.42. Other versions of Snowflake may require integration and configuration steps that differ from those documented in this procedure. For other versions of Snowflake, use this procedure as a starting point for integrating Snowflake. In the event of other issues, contact <support@entrust.com> for assistance.

## Helpful documentation

If you need assistance configuring Snowflake for Identity as a Service authentication, see <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#custom-idp-setup>.

To integrate Snowflake with Identity as a Service, you must do the following

## Step 1: Create a new Snowflake user for testing

note

If you need assistance with this section, see the following Snowflake documentation:

- Create a user: <https://docs.snowflake.com/en/user-guide/admin-user-management.html#creating-users>
- Create a user without a password: <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-use.html#label-users-fed-auth>

1. Log in to your Snowflake system or admin account.

2. Click next to your user name and select **Switch Role > ACCOUNTADMIN**. The **New Worksheet** page appears.

3. Click the **Account** tab. The **Account** page appears.

4. Click **Users**. The **Users** list appears.

5. Click **Create**. The **Create User** dialog box appears.

6. In the **User Name** field, enter a user name for the new user.

7. Enter and confirm a **New Password**.

8. Deselect **Force Password Change**.

9. Click **Next**. The **Advanced** settings appear.

10. In the **Login Name** field, enter the user name of the new user.

11. In the **Email** field, enter the email address of the new user.

12. Click **Next**. The **Preferences** settings appear.

13. From the **Default Role** drop-down list, select **ACCOUNTADMIN**.

14. Click **Finish**.

15. Click the **Worksheets** tab.

16. Ensure that the Role that appears in the Worksheet metadata is also set to **ACCOUNTADMIN**.

note
The role set at the upper right-hand corner can be different from the role at your worksheet.

17. If you need to change the role, do the following:

    1. Click the role. The **Role** dialog box appears.
    2. Click **Change** and select **ACCOUNTADMIN** from the drop-down list.

18. From the **Set Context** drop-down list, select **ACCOUNTADMIN**. You need to do this step to have privileges to submit the SQL query.

19. In the **Worksheet** console, enter: alter user <username> set PASSWORD = ''; where <username> is the name is the new user you just created.

20. Click **Run** and confirm that the operation succeeded. If it does not work, check the SQL syntax and rerun the command.

## Step 2: Add Snowflake to Identity as a Service

Before you begin, you need to obtain the following:

- Assertion Consumer Service URL (Single-Sign URL): See <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#step-2-define-claim-rules-for-the-snowflake-relying-party-trust>. Snowflake refers to this as the **Relying Party Trust**.
- Service Provider Entity ID: See <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#step-2-define-claim-rules-for-the-snowflake-relying-party-trust>. Snowflake refers to this as the **Relying Party Trust Identifier**.
- Single Logout Service URL: See <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#step-3-enable-global-logout-optional>. Snowflake refers to this as the **Logout**.

1. Log into your Identity as a Service administrator account.

2. Click Menu icon **>** **Security > Applications**. The **Applications** **Lists** page appears.

3. Click **Add**. The **Select an Application Template** page appears.

4. Do one of the following:

   - Select **SAML Cloud Integrations** from the search drop-down list and scroll to find the application you want to add to IDaaS.
   - In the **Search bar**, enter a search option to filter for the application you want to add to IDaaS.

5. Click **Snowflake**. The **Add Snowflake** page appears.

6. Enter an **Application Name**.

7. Enter an **Application Description**.

8. Optional. Add a custom application logo.

   1. Click Plus icon next to **Application Logo**. The **Upload Logo** dialog box appears.
   2. Click Upload icon to select an image file to upload.
   3. Browse to select your file and click **Open**. The **Upload Logo** dialog box reappears showing your selected image.
   4. If required, resize your image.
   5. Click **OK**.

9. Select the **Authentication Flow** that appears to users during login.

10. Click **Next**. The **General** page appears.

11. In the **Default Assertion Consumer Service URL** field, enter the URL you obtained from <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#step-2-define-claim-rules-for-the-snowflake-relying-party-trust> (Relying Party Trust).

    Example: https://<account_name>.<region_id>.snowflakecomputing.com/fed/login

12. In the **Service Provider Entity ID** field, enter the URL you obtained from <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#step-2-define-claim-rules-for-the-snowflake-relying-party-trust> (Relying Part Trust Identifier).

    Example: https://<account_name>.<region_id>.snowflakecomputing.com

13. In the **Single Logout Service URL** field, enter the URL you obtained in <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-idp.html#step-3-enable-global-logout-optional> (Logout).

    Example: https://<account_name>.<region_id>.snowflakecomputing.com/fed/logout

14. Optional. Enter the **SAML Username Parameter Name** used to identity the user ID being requested for authentication. The user ID can then be passed as a parameter, for example, Username=jdoe. Alternately, if the SAML username is NameID, the SAML Request XML NameID element value is used to the identify the IDaaS userID.

15. Enter the **SAML Session Timeout** to the time when the SAML Assertion times out. The maximum is 720 minutes.

16. Enter the **Max Authentication Age (seconds)** to set the maximum amount of time that can elapse before a user is required to reauthenticate during a new login attempt. This applies for both SP-initiated and IDP-initiated login. Set this field to -1 to disable this feature.

17. Optional. Enter the **SAML Username Parameter Name** used to identity the user ID being requested for authentication. The user ID can then be passed as a parameter, for example, Username=jdoe.

18. From the **SAML NameID Attribute** drop-down list, select **User ID**.

19. From the **SAML NameID Encoding Format** drop-down list, select **Email**.

20. From the **SAML Signing Certificate** drop-down list, select the signing certificate.

21. From the **SAML Signature Algorithm**, select **SHA256**.

22. Select **Sign the complete SAML Response**.

23. Deselect **Enable Go Back Button** if you do not want users to be able to go back to the Snowflake login page to log in.

24. Select **Show Default Assertion Consumer URL Service in the My Profile**. When selected, the Default Assertion Consumer URL appears in a user's My Profile page in addition to relay states and Alternative Assertion Consumer URLs.

25. Optional. Add **Alternative Assertion Consumer Service URLs**, as follows:

    1. Click **Add**.
    2. Enter a **Name**.
    3. Enter a URL **Value**.
    4. Select **Show in My Profile** to display the Alternative Consumer Service URL in a user's My profile page.
    5. Optional. **Add an Application Logo**.
    6. Click **Add**.
    7. Repeat these steps to add more Alternative Assertion Consumer Service URLs.

26. Click **Submit**.

## Step 3: Add a resource rule

See [Create resource rules](/docs/authentication-and-security/create-and-manage-resource-rules.md).

## Step 4: Copy the SAML Configuration from Identity as a Service

1. Log into your Identity as a Service administrator account.

2. Click Menu icon **>** **Security > Applications**. The **Applications** **Lists** page appears.

3. Under **SAML Cloud Integrations**, click **SAML Configuration**. The **SAML Configuration** dialog box appears. This dialog box contains information you need to configure your SAML application for Identity as a Service authentication.

4. Do one of the following:

   - Leave this dialog box open to reference later in this procedure.
   - Copy the Entity ID, Single Sign-on URL, and Single Logout URL to a text file and save it to reference later in this procedure.

note
Depending on the integration you are performing, you may not need all three of these SAML configuration values. You need to copy the Single Sign-On URL. You need this URL in _Step 6: Configure Snowflake for Identity as a Service authentication_.

## Step 5: Export the signing certificate from Identity as a Service

1. Log in to your Identity as a Service administrator account.
2. Click Menu icon **>** **Security > Applications**. The **Applications List** page appears.
3. Under **SAML Cloud Integrations**, click **SAML Signing Certificates**. The **SAML** **Signing Certificates** page appears.
4. Click next to the certificate to export the certificate you want to import into your SAML service provider application. The **Export Certificate** dialog box appears.
5. If the certificate has been issued by a CA, do one of the following:
   - Click **Certificate** to export the self-signed certificate.
   - Click **Root CA Certificate** to export a certificate issued from a CA.
   - Click **Certificate Chain** to export the SAML signing certificate and its CA certificates.
6. Click **Export**.

## Step 6: Configure Snowflake for Identity as a Service authentication

For assistance with this section, see <https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-configure-snowflake.html#step-2-specify-idp-information-for-snowflake>. To complete this step, you need to issue SQL queries.

1. Log in to your Snowflake account.

2. Click next to your user name and select **Switch Role > ACCOUNTADMIN**. The **New Worksheet** page appears.

3. Click the **Worksheets** tab.

4. From the **Set Context** drop-down list, select **ACCOUNTADMIN**. You need to do this step to have privileges to submit the SQL query.

5. In the **Worksheet** console, construct the SQL query like the following:

   ```text
   use role accountadmin;
   alter account set saml_identity_provider = '{
     "certificate": "",
     "ssoUrl": "",
     "type"  : "Custom",
     "label" : ""
     }';
   ```

6. Open the certificate you copied in _Step 4: Export the signing certificate from Identity as a Service_ with a text editor, such as Notepad.

7. Copy the contents of the certificate, excluding "=====BEGIN CERTIFICATE=====" and "=====END CERTIFICATE=====" and paste into the **certificate** in the Worksheet.

attention
You need to remove all the line breaks to make it one long string.

Example: "certificate": "insert certificate here as one long string",

8. Copy the Single Sign-On URL you copied in _Step 4: Copy the SAML Configuration from Identity as a Service_ and paste into the **ssoURL** in the Worksheet.

   Example: "ssoURL": "https://<my_tenant>.us.trustedauthdev.com/api/saml",

9. The "label" is the button name that appears on the Snowflake Login page for Single Sign-On. Add a user-friendly name without special characters.

   Example: "label": "Entrust",

10. Click **Run** and confirm that the operation succeeded. If it does not, check the SQL syntax and rerun the command.

11. Clear the **Worksheets** so that it is blank again.

12. On the **Worksheet**, construct the SQL query like the following:

    ```text
    use role accountadmin;
    alter account set sso_login_page = true;
    ```

13. Click **Run** and confirm that the operation succeeded. If it does not, check the SQL syntax and rerun the command.

## Step 7: Test the integration

Testing Service Provider Login:

1. Open a Web browser and enter the URL for your Snowflake account. You are directed to Identity as a Service.
2. Enter your Snowflake account **User ID** and click **Next**.
3. Respond to the second-factor authentication challenge. If you respond successfully, you are logged in to the Snowflake.

Testing Identity as a Service redirect log in:

1. Log in to your Identity as a Service account.
2. Go to your **My Profile** page if you are not already there.
3. Under **Applications**, click **Snowflake**.
4. Respond to the second-factor authentication challenge. If you respond successfully, you are logged into Snowflake.
