Authentication to Snowflake

Snowflake has announced plans to require multifactor authentication (MFA) when you access a Snowflake data source. It is recommended that you use MFA when you authenticate to Snowflake interactively. However, there might be situations where it is preferable to use an alternative authentication method, such as when you run SAS scripts overnight. In those cases, we recommend that users update their programs to replace user name and password authentication with RSA key-pair authentication. You or your database administrator should enable key-pair authentication for Snowflake. This is an alternative to MFA that enables SAS programs to connect with Snowflake and to run without interactive MFA. For more information, see the Snowflake documentation.

Note: Support for RSA key-pairs was added in the August 2025 update for SAS 9.4M6 and later.

After RSA keys have been configured and you have access to the private key file and the key password, the key information can be put into a LIBNAME statement for Snowflake. If your RSA key is not encrypted, then you can use a LIBNAME statement similar to this sample:

libname snowlib snow server="server" user='user' schema='schema' 
                     db='db-name' preserve_tab_names=yes
                     conopts="AUTHENTICATOR=SNOWFLAKE_JWT;priv_key_file=path-to-key/rsa_key.p8";

If your RSA key value is encrypted, then the priv_key_file_pwd= value is required in your LIBNAME statement.

libname snowlib snow server="server" user='user' schema='schema' 
                     db='db-name' preserve_tab_names=yes
                     conopts="AUTHENTICATOR=SNOWFLAKE_JWT;priv_key_file=path-to-key/rsa_key.p8;
                           priv_key_file_pwd=password";
Note: It is recommended that you set permissions on the RSA key file and your SAS program to limit access to these files.

For more information, see these topics:

Last updated: February 3, 2026