Skip to content

Commit 4f3b1e6

Browse files
committed
fixed case for non-refreshable tokens
1 parent 23b4016 commit 4f3b1e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/ExternalBrowserCredentialsProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public OAuthHeaderFactory configure(DatabricksConfig config) {
6767

6868
// First try to use the cached token if available (will return null if disabled)
6969
Token cachedToken = tokenCache.load();
70-
if (cachedToken != null && cachedToken.getRefreshToken() != null) {
70+
if (cachedToken != null) {
7171
LOGGER.debug("Found cached token for {}:{}", config.getHost(), clientId);
7272

7373
try {
@@ -84,6 +84,7 @@ public OAuthHeaderFactory configure(DatabricksConfig config) {
8484

8585
CachedTokenSource cachedTokenSource =
8686
new CachedTokenSource.Builder(tokenSource)
87+
.setToken(cachedToken)
8788
.setAsyncDisabled(config.getDisableAsyncTokenRefresh())
8889
.build();
8990
LOGGER.debug("Using cached token, will immediately refresh");

0 commit comments

Comments
 (0)