fix: narrow device-flow OAuth scope to fix login access_denied - #8
Open
nate-kelley-buster wants to merge 1 commit into
Open
nate-kelley-buster wants to merge 1 commit into
nate-kelley-buster wants to merge 1 commit into
Conversation
Requesting "profile offline_access openid" during device-code login causes Yoto's auth server to reject the authorization with access_denied as soon as the user confirms the code (see TheBestMoshe#6). The CLI only needs an access/refresh token to call the Yoto API, so trim the request to the minimal "offline_access" scope. Verified end-to-end: device flow now reaches the consent screen and completes successfully. Fixes TheBestMoshe#6 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182auKxRRCcLdZrBotvbJ6K
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.
Problem
yoto loginfails every time withaccess_deniedimmediately after the user confirms the device code — the consent screen never even appears. This is #6.Root cause
The device-flow token request asks for scope
"profile offline_access openid". Yoto's Auth0 tenant rejects this combination for this client, denying the activation before the user gets a chance to consent.Fix
Narrow the requested scope to just
offline_access, which is the only thing the CLI actually needs (an access/refresh token pair to call the Yoto API — it never uses id-token claims like profile/email).Verification
Reproduced the bug against the live Yoto auth server, confirmed the unpatched build hits
/device/deniedright after clicking Confirm. Applied this one-line change, rebuilt, and the device flow completed normally: consent screen appeared,Acceptsucceeded,yoto statusreported a valid token.Fixes #6