Skip to content

github: parse comma-separated OAuth scopes - #2505

Merged
mjcheetham merged 1 commit into
git-ecosystem:mainfrom
mjcheetham:gh-oauth-scope
Nov 10, 2026
Merged

mjcheetham merged 1 commit into
git-ecosystem:mainfrom
mjcheetham:gh-oauth-scope

Conversation

@mjcheetham

Copy link
Copy Markdown
Contributor

GitHub returns granted OAuth scopes as a comma-separated value in the token response, which deviates from RFC 6749 section 3.3 which calls for a space-delimited format.

Parse GitHub's response using its own format so GCM preserves the scopes granted to the user.

Note that real-world testing shows that GitHub accepts either of space or comma-separated scopes for the 'scope' request parameter/field, so we don't need to change our request logic, only the response handling.

GitHub returns granted OAuth scopes as a comma-separated value in the
token response, which deviates from RFC 6749 section 3.3 which calls
for a space-delimited format.

Parse GitHub's response using its own format so GCM preserves the
scopes granted to the user.

Note that real-world testing shows that GitHub accepts either of space
or comma-separated scopes for the 'scope' request parameter/field, so
we don't need to change our request logic, only the response handling.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
@mjcheetham
mjcheetham requested a review from a team as a code owner November 10, 2026 12:48
@mjcheetham mjcheetham added host:github Specific to the GitHub host provider auth:oauth Specific to OAuth2 authentication labels Nov 10, 2026

@dscho dscho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Just one suggestion, below.

Comment thread src/GitHub/GitHubOAuth2Client.cs Resolved
@mjcheetham
mjcheetham merged commit f0ee0c7 into git-ecosystem:main Nov 10, 2026
24 of 25 checks passed
@mjcheetham
mjcheetham deleted the gh-oauth-scope branch November 10, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth:oauth Specific to OAuth2 authentication host:github Specific to the GitHub host provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants