In my config file, if disable passphrase, I am able to successfully connect to snowflake. if I enable passphrase and try below command i get below error . I create public and private key with PKCS8 format with passphrase. please advice
private_key_path = C:\Users\abcd.snowsql\pkcs8.key
snowsql -a abcd -u a1b1c1 -o log_level=DEBUG --private-key-path C:\Users\abcd.snowsql\pkcs8.key Private Key Passphrase: " here i enter passphrase" 250001 (08001): Failed to connect to DB: XYA86571.snowflakecomputing.com:443. JWT token is invalid. If the error message is unclear, enable logging using -o log_level=DEBUG and see the log to find out the cause. Contact support for further help. Goodbye!
There are multiple possible reasons to cause this issue:
Client machine's time is not synced with NTP server, and caused JWT Token to become invalid due to a token TTL timeout
The backend server only accepts tokens created 60 seconds from the current time, if there are network latency issues, it is possible that by the time the JWT token reaches the backend server, it can be > 60 seconds, and hence cause the invalid token error
For JDBC driver the account parameter in the connection string in under the format: account.region
For SnowSQL driver the wrong username is used
Details: https://community.snowflake.com/s/article/Key-Based-Authentication-Failed-with-JWT-token-is-invalid-Error