Currently, I can use the following DSN: <snowflake_user>@<snowflake_account>/<db_name>/<schema_name>?warehouse=<warehouse>&role=<role>&authenticator=snowflake_jwt&privateKey=<bae64_url_encoded_private_key>.
However, it's not a good security practice to embed the private key into the DSN, so I'd rather pass in a generated JWT like so: <snowflake_user>@<snowflake_account>/<db_name>/<schema_name>?warehouse=<warehouse>&role=<role>&authenticator=snowflake_jwt&token=<jwt_token>. Unfortunately, this doesn't work, because the current implementation expects to derive the JWT token from the private key here. It also panics if the privateKey parameter isn't set, but that should yield a validation error instead...
It would be great to allow users to pass in a JWT token directly as an alternative to privateKey when authenticator=snowflake_jwt.
thank you for raising this enhancement request with us - we'll consider adding the capability, but i cannot commit to any estimated timelines. thank you for bearing with us !
Issue description
Currently, I can use the following DSN:
<snowflake_user>@<snowflake_account>/<db_name>/<schema_name>?warehouse=<warehouse>&role=<role>&authenticator=snowflake_jwt&privateKey=<bae64_url_encoded_private_key>
.However, it's not a good security practice to embed the private key into the DSN, so I'd rather pass in a generated JWT like so:
<snowflake_user>@<snowflake_account>/<db_name>/<schema_name>?warehouse=<warehouse>&role=<role>&authenticator=snowflake_jwt&token=<jwt_token>
. Unfortunately, this doesn't work, because the current implementation expects to derive the JWT token from the private key here. It also panics if theprivateKey
parameter isn't set, but that should yield a validation error instead...It would be great to allow users to pass in a JWT
token
directly as an alternative toprivateKey
whenauthenticator=snowflake_jwt
.Example code
N/A
Error log
Configuration
Driver version (or git SHA): v1.6.13
Go version: go1.19.2 darwin/amd64
Server version: 6.32.3
Client OS: OSX Monterey 12.6