Repository navigation
Conversation
Servers that enforce OAuth scopes (from 2.38) refused the extension right after sign-in: `/users/me` needs `user:read`. Request what the extension and the CLI it runs need: the `coder:workspaces.operate` and `coder:workspaces.access` composites, `workspace:create`, `user:read` and `user:read_personal`. Request `inbox_notification:read` only when the server lists it in `scopes_supported`, since servers reject unknown scopes and 2.38 does not offer it yet. Store `coder:all` when the server returns no scope, as servers that ignore scopes grant everything, so later scope changes do not sign their users out. Sessions stored with the old list sign in again once. Revoke tokens on logout even when their scopes are outdated, and accept sessions granted `coder:all`.
EhabY
force-pushed
the
fix/oauth-request-scopes
branch
from
October 7, 2026 08:45
c9eff9e to
e5d637a
Compare
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.
Fixes VSC-24
Split out of #1128, which now holds only the live-server scope suite and is stacked on this PR.
Problem
Servers that enforce OAuth scopes (from 2.38) refuse the extension right after sign-in:
GET /users/meneedsuser:read. An audit against a live server (#1128) found more gaps with the same cause:user:read. Without it, remote SSH, ping, speedtest, support bundle,coder startandcoder updatebreak.user:read(owner lookup), and stop builds needworkspace:stop.organization_member:read, which only thecoder:workspaces.*composites grant.coder startdry-runs a build when a workspace must update first (workspace:create).inbox_notification:read(fix: let scoped tokens list and mark inbox notifications read coder#30176).Fix
inbox_notification:readis requested only when the server lists it inscopes_supported. Servers reject the whole request over an unknown scope, andrelease/2.38doesn't offer it yet. Sessions without it stay valid and pick it up at the next sign-in.scope, the extension storescoder:all. Only servers that ignore scopes do that, and they grant everything, so later scope changes no longer sign their users out. The stored value is used only byhasRequiredScopes; it is never sent to the server.coder:allare accepted.Everyone signed in with OAuth signs in again once. Their stored sessions carry the old list, which no longer covers the required scopes. The CHANGELOG says so.
Size
181 additions and 68 deletions in 9 files:
src/oauth: +92/−60. Of that,hasRequiredScopesmoves fromsessionManager.tstoutils.ts, so the live suite in test(oauth): check OAuth scopes against a live server #1128 can call it.Tests
scopes_supportedcoder:allsessionscoder:allwhen the server returns no scope🤖 Generated with Claude Code