Categories:

User & Security DDL (Third-Party Service Integrations)

# CREATE SECURITY INTEGRATION (SAML2)¶

Creates a new SAML2 security integration in the account or replaces an existing integration. A SAML2 security integration provides single sign-on (SSO) workflows by creating an interface between Snowflake and a third-party Identity Provider (IdP).

For information about creating other types of security integrations (e.g. SCIM), see CREATE SECURITY INTEGRATION.

In this Topic:

## Syntax¶

CREATE [ OR REPLACE ] SECURITY INTEGRATION [ IF NOT EXISTS ]
TYPE = SAML2
ENABLED = TRUE | FALSE
SAML2_ISSUER = '<string_literal>'
SAML2_SSO_URL = '<string_literal>'
SAML2_PROVIDER = '<string_literal>'
SAML2_X509_CERT = '<string_literal>'
[ SAML2_ENABLE_SP_INITIATED = TRUE | FALSE ]
[ SAML2_SNOWFLAKE_X509_CERT = '<string_literal>' ]
[ SAML2_SIGN_REQUEST = TRUE | FALSE ]
[ SAML2_REQUESTED_NAMEID_FORMAT = '<string_literal>' ]
[ SAML2_POST_LOGOUT_REDIRECT_URL = '<string_literal>' ]
[ SAML2_FORCE_AUTHN = TRUE | FALSE ]
[ SAML2_SNOWFLAKE_ISSUER_URL = '<string_literal>' ]
[ SAML2_SNOWFLAKE_ACS_URL = '<string_literal>' ]


## Required Parameters¶

name

String that specifies the identifier (i.e. name) for the integration; must be unique in your account.

In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier Requirements.

TYPE = SAML2

Specify the type of integration:

• SAML2: Creates a security interface between Snowflake and the identity provider.

ENABLED = TRUE | FALSE

The Boolean that specifies whether to initiate operation of the integration or suspend it.

• TRUE allows the integration to run based on the parameters specified in the pipe definition.

• FALSE suspends the integration for maintenance. Any integration between Snowflake and a third-party service fails to work.

SAML2_ISSUER = 'string_literal'

The string containing the IdP EntityID / Issuer.

SAML2_SSO_URL = 'string_literal'

The string containing the IdP SSO URL, where the user should be redirected by Snowflake (the Service Provider) with a SAML AuthnRequest message.

SAML2_PROVIDER = 'string_literal'

The string describing the IdP.

One of the following: OKTA, ADFS, Custom.

SAML2_X509_CERT = 'string_literal'

The Base64 encoded IdP signing certificate on a single line without the leading -----BEGIN CERTIFICATE----- and ending -----END CERTIFICATE----- markers.

## Optional Parameters¶

SAML2_SP_INITIATED_LOGIN_PAGE_LABEL = 'string_literal'

The string containing the label to display after the Log In With button on the login page.

SAML2_ENABLE_SP_INITIATED = TRUE | FALSE

• TRUE displays the Log in With button on the login page.

• FALSE does not display the Log in With button on the login page..

SAML2_SNOWFLAKE_X509_CERT = 'string_literal'

The Base64 encoded self-signed certificate generated by Snowflake for use with Encrypting SAML Assertions and Signed SAML Requests.

You must have at least one of these features (encrypted SAML assertions or signed SAML responses) enabled in your Snowflake account to access the certificate value.

SAML2_SIGN_REQUEST = TRUE | FALSE

The Boolean indicating whether SAML requests are signed.

• TRUE allows SAML requests to be signed.

• FALSE does not allow SAML requests to be signed.

SAML2_REQUESTED_NAMEID_FORMAT = 'string_literal'

The SAML NameID format allows Snowflake to set an expectation of the identifying attribute of the user (i.e. SAML Subject) in the SAML assertion from the IdP to ensure a valid authentication to Snowflake. If a value is not specified, Snowflake sends the urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress value in the authentication request to the IdP.

Optional.

If you choose to specify the SAML NameID format, use one of the following values:

• urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified

• urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress

• urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName

• urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName

• urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos

• urn:oasis:names:tc:SAML:2.0:nameid-format:persistent

• urn:oasis:names:tc:SAML:2.0:nameid-format:transient

SAML2_POST_LOGOUT_REDIRECT_URL = '<string_literal>'

The endpoint to which Snowflake redirects users after clicking the Log Out button in the classic web interface.

Snowflake terminates the Snowflake session upon redirecting to the specified endpoint.

SAML2_FORCE_AUTHN = TRUE | FALSE

The Boolean indicating whether users, during the initial authentication flow, are forced to authenticate again to access Snowflake. When set to TRUE, Snowflake sets the ForceAuthn SAML parameter to TRUE in the outgoing request from Snowflake to the identity provider.

• TRUE forces users to authenticate again to access Snowflake, even if a valid session with the identity provider exists.

• FALSE does not force users to authenticate again to access Snowflake.

Default: FALSE.

SAML2_SNOWFLAKE_ISSUER_URL = '<string_literal>'

The string containing the EntityID / Issuer for the Snowflake service provider.

If an incorrect value is specified, Snowflake returns an error message indicating the acceptable values to use.

The value of this property must match the Snowflake account URL specified in the IdP. It defaults to the legacy URL, so if you define a different URL format in the IdP, make sure to set this property appropriately when creating the security integration. For details, see Option 2: Create a Security Integration.

SAML2_SNOWFLAKE_ACS_URL = '<string_literal>'

The string containing the Snowflake Assertion Consumer Service URL to which the IdP will send its SAML authentication response back to Snowflake. This property will be set in the SAML authentication request generated by Snowflake when initiating a SAML SSO operation with the IdP.

If an incorrect value is specified, Snowflake returns an error message indicating the acceptable values to use.

The value of this property must match the Snowflake account URL specified in the IdP. It defaults to the legacy URL, so if you define a different URL format in the IdP, make sure to set this property appropriately when creating the security integration. For details, see Option 2: Create a Security Integration.

Default: https://<account_locator>.<region>.snowflakecomputing.com/fed/login

## Access Control Requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE INTEGRATION

Account

Only the ACCOUNTADMIN role has this privilege by default. The privilege can be granted to additional roles as needed.

For instructions on creating a custom role with a specified set of privileges, see Creating Custom Roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Access Control in Snowflake.

## Usage Notes¶

Attention

Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata Fields in Snowflake.

## Example¶

The following example creates a Microsoft Active Directory Federation Services (ADFS) security integration with the two optional settings:

create security integration my_idp
type = saml2
enabled = true
saml2_issuer = 'https://example.com'
saml2_sso_url = 'http://myssoprovider.com'

DESC SECURITY INTEGRATION my_idp;