Skip to content

Conversation

@parthban-db
Copy link
Contributor

@parthban-db parthban-db commented Jul 4, 2025

What changes are proposed in this pull request?

Users with membership in multiple Databricks accounts are sent to an incorrect authorization URL with the external-browser auth type in the Java SDK. Because the new DatabricksConfig created in the OAuthClient doesn't include the account ID so getOidcEndpoints returns endpoints with no account ID in the path. Which redirects it to the default account and not the account that was specified in the intial Config.

How is this tested?

Manually tested that it is not the case anymore using the below code.

    public static void main(String[] args) {

        DatabricksConfig config = new DatabricksConfig()
        .setAuthType("external-browser")
        .setHost("https://accounts.cloud.databricks.com")
        .setAccountId("<redacted>")
        .setScopes(List.of("all-apis", "offline_access"))
        .setOAuthRedirectUrl("http://localhost:8022");

        AccountClient acct = new AccountClient(config);
        for (Workspace w: acct.workspaces().list()){
            System.out.println(w.getWorkspaceName());
        }
    }

The current code is not flexible enough to have unit tests in it and needs a bigger refactor. So, unit tests are not added.
NO_CHANGELOG=true

@github-actions
Copy link

github-actions bot commented Jul 4, 2025

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 479
  • Commit SHA: 99adb729a361aab4f84d510e21138d0dc2309b43

Checks will be approved automatically on success.

@parthban-db parthban-db added this pull request to the merge queue Jul 4, 2025
Merged via the queue into main with commit b50289c Jul 4, 2025
15 checks passed
@parthban-db parthban-db deleted the parthban-db/pass-account-id-in-oauth-client branch July 4, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants