Allow the use of different client IDs in U2M auth - #6594
Merged
Merged
Conversation
Collaborator
Integration test reportCommit: 7cd98de
Top 6 slowest tests (at least 2 minutes):
|
renaudhartert-db
enabled auto-merge
September 10, 2026 16:23
mihaimitrea-db
left a comment
Contributor
There was a problem hiding this comment.
Have a look at the comment
Comment on lines
+115
to
+118
| clientIDConfig, ok := cfg.GetAuthDetails().Configuration["client_id"] | ||
| if ok && clientIDConfig.Source.Type == config.SourceFile { | ||
| opts = append(opts, u2m.WithClientID(cfg.ClientID)) | ||
| } |
Contributor
There was a problem hiding this comment.
[edge case] If you have a correctly setup profile using the client ID you want, but also set DATABRICKS_CLIENT_ID, this piece of code will make the CLI use its default Client ID.
This is because the cfg first resolves env variables, making this if statement here fail.
mihaimitrea-db
approved these changes
Sep 10, 2026
Collaborator
Integration test reportCommit: d1d367d
498 interesting tests: 492 FAIL, 5 KNOWN, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Allow OAuth U2M authentication to override the CLI client ID through profile
client_idorDATABRICKS_CLIENT_ID, and adddatabricks auth login --client-id. The flag overrides an existing profile value and persists the effective client ID for login, token refresh, and discovery login.The U2M credential strategy accepts the resolved client ID regardless of whether it came from the profile, environment, or dynamic configuration. The override remains restricted to the
databricks-cliauth type so M2M credentials do not leak into U2M.Why
Organizations may need the CLI U2M flow to authenticate through a custom OAuth application while keeping the override scoped to an explicit login, profile, or environment.
Tests
libs/authtests covering file, environment, and dynamic client ID sourcesThe full acceptance sweep was blocked before execution because this machine has jq 1.6 and the suite requires jq 1.7 or newer. The pinned Python formatter/linter could not be downloaded because PyPI DNS was unavailable; no Python files changed.
This PR was written by Codex.