Skip to content

fix: narrow device-flow OAuth scope to fix login access_denied - #8

Open
nate-kelley-buster wants to merge 1 commit into
TheBestMoshe:mainfrom
nate-kelley-buster:fix/device-flow-scope-access-denied
Open

nate-kelley-buster wants to merge 1 commit into
TheBestMoshe:mainfrom
nate-kelley-buster:fix/device-flow-scope-access-denied

Conversation

@nate-kelley-buster

Copy link
Copy Markdown

Problem

yoto login fails every time with access_denied immediately 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/denied right after clicking Confirm. Applied this one-line change, rebuilt, and the device flow completed normally: consent screen appeared, Accept succeeded, yoto status reported a valid token.

Fixes #6

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
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.

Login fails

1 participant