Repository navigation
Split device code login into authorization and token exchange steps - #7217
Open
maksim-zuev-db wants to merge 3 commits into
Open
maksim-zuev-db wants to merge 3 commits into
maksim-zuev-db wants to merge 3 commits into
Conversation
Export RequestDeviceAuthorization and ExchangeDeviceCode so a login can be completed by a separate command, and rebuild DeviceCodeChallenge on top of them. Rejected codes now match ErrInvalidConfirmationCode or ErrInvalidDeviceCode, so callers no longer compare the server's description. Export NormalizeCode so that callers can compare codes the way the user enters them. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 113e772
Top 6 slowest tests (at least 2 minutes):
|
RequestDeviceAuthorization errors already say which step failed, and DeviceCodeChallenge adds the same prefix to its token exchange errors. Co-authored-by: Isaac <no-reply@databricks.com>
This was referenced Oct 28, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
maksim-zuev-db
marked this pull request as ready for review
October 28, 2026 15:58
maksim-zuev-db
requested review from
renaudhartert-db
and removed request for
renaudhartert-db
October 28, 2026 15:58
This branch has not been deployed
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
A refactoring for the upcoming non-interactive device code login flow, with no user-visible change.
libs/auth/u2mexports the two steps of device code login,RequestDeviceAuthorizationandExchangeDeviceCode, andDeviceCodeChallengeis rebuilt on top of them. A rejected code matchesErrInvalidConfirmationCodeorErrInvalidDeviceCode, andNormalizeCodeis exported.Why
In the non-interactive flow, used when stdin is not a terminal (e.g. when an AI agent runs the login), one CLI invocation requests the device authorization and a later one exchanges the device code. The test migration (#7222) and the flow itself (#7220) are stacked on top.
Tests
New unit tests for both steps and their errors. Existing tests pass unchanged.
This pull request and its description were written by Isaac.