You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh auth login --with-token accepts a token without the advertised workflow scope #14754
gh auth login --with-token advertises a minimum scope set that it does not
enforce: the flow prints "The minimum required scopes are 'repo', 'read:org',
'workflow'", but the login completes successfully with a token that carries no workflow scope.
Environment
gh 2.102.0 (2026-09-30)
Linux x86_64
Classic PAT (not fine-grained)
Reproduction
Create a classic personal access token with the scopes repo, read:org
and read:project. Do not grant workflow.
Run gh auth login --hostname github.com --with-token and paste the token
at the prompt.
The login completes without an error.
Run gh auth status. It reports: - Token scopes: 'read:org', 'read:project', 'repo'
Expected
Either the pasted token is rejected because it lacks the advertised workflow scope, or the hint lists only the scopes that are actually
required.
Actual
The token is accepted, and the advertised workflow scope is never checked.
The stored credential works for API calls while lacking a scope the flow
claimed to require.
Additional Context
The hint is printed by the paste-token flow. The browser (OAuth) flow
requests a different scope set, so the two flows do not agree on what
"minimum" means.
Not verified whether the missing check is intentional, or whether the hint
is simply a copy of the OAuth scope set.
Relevant to any setup that treats the printed scopes as an enforced
contract rather than a suggestion.
Thanks for the detailed report. I traced this through the current source (commit ed40e856) and your diagnosis checks out as a real discrepancy, not just a hypothesis.
The --with-token flow in login.go line 75 advertises repo, read:org, and gist as the minimum required scopes.
Both paths call HasMinimumScopes → HeaderHasMinimumScopes in oauth_scopes.go lines 72-92, which only ever checks for repo and read:org/write:org/admin:org. It never checks workflow or gist.
So the hint text and the enforcement function are simply out of sync: whatever scopes are printed to the user beyond repo/read:org (gist, workflow, admin:public_key) are never actually validated. This matches your reproduction exactly. I don't see an existing duplicate issue for this specific scope-validation gap. Suggesting bug, gh-auth, and priority-3 (narrow, workaround available, no data loss) — a maintainer should decide whether to extend HeaderHasMinimumScopes to cover all advertised scopes or trim the advertised scope list to match what's enforced.
Activity
cli-triage commentedon Oct 19, 2026
Thanks for the detailed report. I traced this through the current source (commit
ed40e856) and your diagnosis checks out as a real discrepancy, not just a hypothesis.--with-tokenflow inlogin.goline 75 advertisesrepo,read:org, andgistas the minimum required scopes.login_flow.golines 165-169 builds its ownminimumScopessentence (repo,read:org, plus anyadditionalScopes, which can includeworkflow— seegit_credential.goline 36).HasMinimumScopes→HeaderHasMinimumScopesinoauth_scopes.golines 72-92, which only ever checks forrepoandread:org/write:org/admin:org. It never checksworkfloworgist.So the hint text and the enforcement function are simply out of sync: whatever scopes are printed to the user beyond
repo/read:org(gist,workflow,admin:public_key) are never actually validated. This matches your reproduction exactly. I don't see an existing duplicate issue for this specific scope-validation gap. Suggestingbug,gh-auth, andpriority-3(narrow, workaround available, no data loss) — a maintainer should decide whether to extendHeaderHasMinimumScopesto cover all advertised scopes or trim the advertised scope list to match what's enforced.