Skip to content

Device code auth - #7093

Draft
maksim-zuev-db wants to merge 2 commits into
mainfrom
device-code
Draft

maksim-zuev-db wants to merge 2 commits into
mainfrom
device-code

Conversation

@maksim-zuev-db

@maksim-zuev-db maksim-zuev-db commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Changes

Implementation of device code auth flow. The backend implementation is still not finalized in production, so this change introduces --use-device-code flag as experimental, hidden under DATABRICKS_CLI_DEVICE_CODE env variable.

Why

The Device Code flow enables users to authenticate with the Databricks CLI on machines that don't have browser access (e.g. headless servers, SSH sessions, web terminals). Instead of the standard browser-redirect OAuth flow, the user authenticates on a separate device (e.g. their phone or laptop) by entering a short code.

Tests

  • Unit tests cover the protocol logic and the auth login helpers, including
    edge cases like expiry, retries and cancellation.
  • Acceptance tests run the CLI end to end against libs/testserver, which now
    models Databricks' device code flow. Confirmation codes are piped through
    stdin. The tests cover the successful login and each error scenario.
  • Manual tests: only dev environments support device code now.

maksim-zuev-db and others added 2 commits October 16, 2026 15:26
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@maksim-zuev-db
maksim-zuev-db requested review from a team as code owners October 16, 2026 15:50
@maksim-zuev-db
maksim-zuev-db marked this pull request as draft October 16, 2026 15:51
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: fd59775

Run: 38927249919

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 276 19 5:42
✅​ aws-windows-latest-4core-16gb 278 17 5:10
✅​ azure linux-2core-8gb 275 19 5:30
✅​ azure-windows-latest-4core-16gb 277 17 4:14
✅​ gcp linux-2core-8gb 276 19 5:25
✅​ gcp-windows-latest-4core-16gb 278 17 5:21
Top 6 slowest tests (at least 2 minutes):
duration env testname
5:13 gcp-windows-latest-4core-16gb TestAccept
5:01 aws-windows-latest-4core-16gb TestAccept
4:08 azure-windows-latest-4core-16gb TestAccept
4:01 aws linux-2core-8gb TestAccept
3:50 azure linux-2core-8gb TestAccept
3:44 gcp linux-2core-8gb TestAccept

This branch has not been deployed

No deployments
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