JDBC Driver cannot connect when using TokenCachePassPhrase property
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 09:04 AM - edited 04-29-2025 09:09 AM
Hello all, I'm looking for suggestions on enabling the token cache when using browser based SSO login. I'm following the instructions found here: Databricks-JDBC-Driver-Install-and-Configuration-Guide
For my users, I would like to enable the token cache as it provides a more seamless experience. The driver documentation suggests setting the TokenCachePassPhrase property, but does not elaborate on where I can obtain such a value. So, I created my JDBC connection string like this.
jdbc:databricks://my.prefix.databricks.com:443/default;transportMode=http;ssl=1;AuthMech=11;Auth_Flow=2;
httpPath=/sql/1.0/warehouses/<WAREHOUSE_ID>;UseProxy=1;ProxyHost=<PROXY_HOST>;ProxyPort=<PROXY_PORT>;
TokenCachePassPhrase=cache;PWD=cache;EnableTokenCache=1;
However, the driver returns this following exception. When the EnableTokenCache is set to 0, it connects successfully.
[Databricks][JDBCDriver](500151) Error setting/closing session: Cannot invoke "java.nio.file.attribute.AclFileAttributeView.setAcl(java.util.List)" because "<local6>" is null .
Cannot invoke "java.nio.file.attribute.AclFileAttributeView.setAcl(java.util.List)" because "<local6>" is null
So, can anyone elaborate on what this TokenCachePassPhrase property should be set to? Is it an arbitrary value or a secret known to an administrator? Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 09:29 PM - edited 04-30-2025 09:32 PM
The TokenCachePassPhrase property is meant to secure tokens when using the token cache feature of the Databricks JDBC driver. This passphrase serves as an encryption key for storing the tokens securely in the cache.
General Guidelines for Setting TokenCachePassPhrase:
- This property should be set to a passphrase that you and your organization control, similar to a password.
- Ensure that the same passphrase is consistently used for all connections that leverage the token cache.
- Ideally, pick a strong passphrase and do not expose it unnecessarily.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 09:33 PM
For the error encountered (Cannot invoke "java.nio.file.attribute.AclFileAttributeView.setAcl(...)" because "<local6>" is null) might be permission or file system issues where the token cache store is being accessed.
When EnableTokenCache=0, the token cache is disabled, which explains why the connection succeeds without issues.