SNOW-675319: Support JWT authentication by passing in a valid JWT token directly in the DSN #671
Labels
enhancement
The issue is a request for improvement or a new feature
status-triage_done
Initial triage done, will be further handled by the driver team
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
The text was updated successfully, but these errors were encountered: