Repository navigation
DEV-448: add /device page to approve device code sign-in - #23
Merged
xkickflip merged 1 commit intoNov 21, 2026
Merged
Conversation
- /device?code=BCDF-GHJK signs you in first if needed, then names the app asking (GET /v1/auth/device) and shows the code to compare - Approve or Deny posts to /v1/auth/device/approve; the device's agent gets its tokens on its next poll - Bare /device asks for the code; any case, with or without the dash - Expired, used, unverified-account and rate-limited codes get their own messages
xkickflip
deleted the
chris-dev-448-add-device-code-login-rfc-8628-for-terminal
branch
November 21, 2026 01:25
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.
Summary
Terminal and headless sign-in currently depends on the localhost callback, which needs a browser on the same machine as the agent and, in the Safari fallback, puts tokens in browser history and access logs. This adds the web half of the OAuth 2.0 Device Authorization Grant (RFC 8628): the verification page where you approve a device code. Tokens then go straight to the polling client, so nothing has to pass from the browser to the local API.
/devicepage (theverification_uri)./device?code=BCDF-GHJK(verification_uri_complete) arrives with the code filled in. Bare/deviceasks you to type the code, accepting any case, with or without the dash./login?redirect=/device?code=…and come back with the same code.GET /v1/auth/device?code=and names the requesting app before anything is approved, so you approve only when it shows the same code.{ user_code, approve }to/v1/auth/device/approve. Deny gives the clientaccess_denied.Test plan
docentand open theverification_uri_completelink while signed out. Sign in and confirm you land back on/devicewith the code filled in./device, type the code in lowercase without the dash, and confirm it is accepted and the app name is shown.access_deniedand the page says nothing was signed in.