<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Connecting to Snowflake using JDBC and key pair authentication (ssh) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774310#M246088</link>
    <description>&lt;P&gt;I am working on the SAS Grid AIX system using SAS Enterprise Guide. I'm trying to connect to a Snowflake sandbox environment as a POC to prove that AIX's JDBC connector will connect to Snowflake.&amp;nbsp; On top of that, I'm required to use key pairs (SSH RSA keys) to authenticate. I'm having trouble with the syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested the key pairs using Snowsql. I was able to connect, so I know that the keys are working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
connect to jdbc as C (driverclass="net.snowflake.client.jdbc.SnowflakeDriver"
URL="jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com" authenticator=SNOWFLAKE_JWT private_key_file=/home/user/rsa_key.p8 private_key_file_pwd=mypwd classpath="/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar");
select * from connection to C (select count(*) from DB_NAME.SCHEMA_NAME.TABLE_NAME);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR: Invalid option name authenticator.&lt;BR /&gt;ERROR: The C engine cannot be found.&lt;BR /&gt;ERROR: A Connection to the C DBMS is not currently supported, or is not installed at your site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname snow1 jdbc driver='net.snowflake.client.jdbc.SnowflakeDriver'
classpath='/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar'
URL='jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com/?authenticator=SNOWFLAKE_JWT&amp;amp;private_key_file=/home/user/rsa_key.p8&amp;amp;private_key_file_pwd=mypwd
&amp;amp;user=user@mycompany.com&amp;amp;db=DB_NAME&amp;amp;schema=SCHEMA_NAME'
schema='SCHEMA_NAME'
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR: Error trying to establish connection: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid&lt;BR /&gt;or not supported: /home/user/rsa_key.p8: /home/user/rsa_key.p8&lt;BR /&gt;ERROR: Error in the LIBNAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname snow1 jdbc driver='net.snowflake.client.jdbc.SnowflakeDriver'
classpath='/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar'
URL='jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com'
user="user"
authenticator=SNOWFLAKE_JWT 
private_key_file='/home/user/rsa_key.p8'
private_key_file_pwd='mypwd' 
classpath="/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar"
schema='SCHEMA_NAME';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR 22-7: Invalid option name AUTHENTICATOR.&lt;BR /&gt;ERROR 22-7: Invalid option name PRIVATE_KEY_FILE.&lt;BR /&gt;ERROR 22-7: Invalid option name PRIVATE_KEY_FILE_PWD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 18:20:46 GMT</pubDate>
    <dc:creator>jcamp</dc:creator>
    <dc:date>2021-10-14T18:20:46Z</dc:date>
    <item>
      <title>Connecting to Snowflake using JDBC and key pair authentication (ssh)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774310#M246088</link>
      <description>&lt;P&gt;I am working on the SAS Grid AIX system using SAS Enterprise Guide. I'm trying to connect to a Snowflake sandbox environment as a POC to prove that AIX's JDBC connector will connect to Snowflake.&amp;nbsp; On top of that, I'm required to use key pairs (SSH RSA keys) to authenticate. I'm having trouble with the syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested the key pairs using Snowsql. I was able to connect, so I know that the keys are working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
connect to jdbc as C (driverclass="net.snowflake.client.jdbc.SnowflakeDriver"
URL="jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com" authenticator=SNOWFLAKE_JWT private_key_file=/home/user/rsa_key.p8 private_key_file_pwd=mypwd classpath="/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar");
select * from connection to C (select count(*) from DB_NAME.SCHEMA_NAME.TABLE_NAME);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR: Invalid option name authenticator.&lt;BR /&gt;ERROR: The C engine cannot be found.&lt;BR /&gt;ERROR: A Connection to the C DBMS is not currently supported, or is not installed at your site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname snow1 jdbc driver='net.snowflake.client.jdbc.SnowflakeDriver'
classpath='/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar'
URL='jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com/?authenticator=SNOWFLAKE_JWT&amp;amp;private_key_file=/home/user/rsa_key.p8&amp;amp;private_key_file_pwd=mypwd
&amp;amp;user=user@mycompany.com&amp;amp;db=DB_NAME&amp;amp;schema=SCHEMA_NAME'
schema='SCHEMA_NAME'
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR: Error trying to establish connection: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid&lt;BR /&gt;or not supported: /home/user/rsa_key.p8: /home/user/rsa_key.p8&lt;BR /&gt;ERROR: Error in the LIBNAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname snow1 jdbc driver='net.snowflake.client.jdbc.SnowflakeDriver'
classpath='/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar'
URL='jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com'
user="user"
authenticator=SNOWFLAKE_JWT 
private_key_file='/home/user/rsa_key.p8'
private_key_file_pwd='mypwd' 
classpath="/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar"
schema='SCHEMA_NAME';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR 22-7: Invalid option name AUTHENTICATOR.&lt;BR /&gt;ERROR 22-7: Invalid option name PRIVATE_KEY_FILE.&lt;BR /&gt;ERROR 22-7: Invalid option name PRIVATE_KEY_FILE_PWD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 18:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774310#M246088</guid>
      <dc:creator>jcamp</dc:creator>
      <dc:date>2021-10-14T18:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake using JDBC and key pair authentication (ssh)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774406#M246127</link>
      <description>&lt;P&gt;The second one is the closest, the others use unsupported syntax.&lt;/P&gt;
&lt;P&gt;You can use the libname in proc sql by coding:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;libname SNOW1 jdbc ...;&lt;BR /&gt;proc&amp;nbsp;sql;&lt;BR /&gt;&amp;nbsp;connect&amp;nbsp;using&amp;nbsp;SNOW1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I suppose the break before &lt;FONT face="courier new,courier"&gt;&amp;amp;user=&lt;/FONT&gt; is not in the program?&lt;/P&gt;
&lt;P&gt;The syntax seems correct according to this &lt;A href="https://docs.snowflake.com/en/user-guide/jdbc-configure.html#private-key-file-name-and-password-as-connection-properties" target="_self"&gt;page&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Now the only issue remaining seems to be the private key: snowflake rejects it.&lt;/P&gt;
&lt;P&gt;What do the snowflake admins see?&lt;/P&gt;
&lt;P&gt;I suggest you open a SAS Tech support incident so you can get guidance directly from the snowflake developers.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 00:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774406#M246127</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-10-15T00:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Snowflake using JDBC and key pair authentication (ssh)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774502#M246175</link>
      <description>&lt;P&gt;Thank you, yes the break before &amp;amp;user does not exist in the actual program. Based on your suggestion, I opened a SAS Tech support incident.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-Snowflake-using-JDBC-and-key-pair-authentication/m-p/774502#M246175</guid>
      <dc:creator>jcamp</dc:creator>
      <dc:date>2021-10-15T14:09:30Z</dc:date>
    </item>
  </channel>
</rss>

