Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.net.ServerSocket;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -196,6 +197,8 @@ public void setupU2MConfig() throws DatabricksParsingException {
.setAuthType(DatabricksJdbcConstants.U2M_AUTH_TYPE)
.setHost(host)
.setClientId(clientId)
.setOAuthBrowserAuthTimeout(
Duration.ofHours(1)) // TODO : add a browser timeout connection config
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. what was the previous default?
  2. can we remove the todo? since this is a user interactive flow, i don't think we ever need this to be configurable?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It used to wait indefinitely for user interaction, which can cause applications to hang indefinitely if
    users don't complete the authentication process.
  2. This is a feature ask because of legacy driver parity. Doc : https://docs.google.com/document/d/17wkI_I16_k6Igl0QPDWZkgbg-7VApebyO4D1yVeXfpM/edit?tab=t.0#heading=h.ig8zh4bt1u8z

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added this in the PR description for more context. Thanks

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

.setClientSecret(connectionContext.getClientSecret())
.setOAuthRedirectUrl(redirectUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.databricks.sdk.core.utils.Cloud;
import java.io.IOException;
import java.net.ServerSocket;
import java.time.Duration;
import java.util.List;
import java.util.Properties;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -453,6 +454,7 @@ void getWorkspaceClient_OAuthWithBrowserBasedAuthentication_SetsCustomRedirectUr
assertEquals("browser-client-id", config.getClientId());
assertEquals("browser-client-secret", config.getClientSecret());
assertEquals(List.of("scope1", "scope2"), config.getScopes());
assertEquals(Duration.ofHours(1), config.getOAuthBrowserAuthTimeout());
assertEquals("http://localhost:" + testPort, config.getOAuthRedirectUrl());
assertEquals(DatabricksJdbcConstants.U2M_AUTH_TYPE, config.getAuthType());
}
Expand Down
Loading