Skip to content

Fix U2M OAuth flows in Azure #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: renaud-hartert_data/unify-endpoint
Choose a base branch
from

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Jun 19, 2025

What changes are proposed in this pull request?

This PR fixes some issues affecting the end-to-end workflow using External Browser auth in Azure. In addition to the base PR by @renaudhartert-db:

  1. This corrects the default redirect URL for the Databricks CLI to http://localhost:8020, matching the Go SDK.
  2. This fixes OAuth token caching to include the actual scopes requested in the hash (otherwise, if no scopes are requested, that is treated as null today, causing an NPE).
  3. This removes legacy Azure-specific handling for U2M Auth, where we requested the 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/user_impersonation permission. This is not needed anymore, since we login with the Databricks CLI App by default.
  4. This fixes serialization of query parameters, using the standard UrlEncoder instead of the very approximate version replacing spaces with %20.
  5. This changes the default scopes requested to be offline_access and all-apis, matching the defaults for the Go SDK & CLI.

How is this tested?

I wrote a demo app using U2M OAuth to authenticate and make an API request:

package com.databricks.sdk.demo;

import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.core.DatabricksConfig;

public class App {
    public final static void main(String[] args) {
        DatabricksConfig config = new DatabricksConfig()
          .setHost("https://<azure workspace host>")
          .setAuthType("external-browser");
        WorkspaceClient client = new WorkspaceClient(config);

        System.out.println(client.currentUser().me());
    }
}

This succeeded.

@mgyucht mgyucht temporarily deployed to test-trigger-is June 19, 2025 13:59 — with GitHub Actions Inactive
Copy link

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

@mgyucht mgyucht temporarily deployed to test-trigger-is June 19, 2025 13:59 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is June 19, 2025 14:01 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is June 19, 2025 14:01 — with GitHub Actions Inactive
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.

2 participants