Skip to content

Add offline_access to default scopes and fix PRM scope discovery - #3794

Merged
jhrozek merged 1 commit into
mainfrom
fix/prm-scope-defaults
Feb 13, 2026
Merged

jhrozek merged 1 commit into
mainfrom
fix/prm-scope-defaults

Conversation

@jhrozek

@jhrozek jhrozek commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

MCP clients like VS Code resolve OAuth scopes from the Protected Resource Metadata (RFC 9728) scopes_supported field. When no explicit scopes were configured, the PRM handler defaulted to ["openid"], causing clients to never request offline_access and therefore never receive refresh tokens.

Separate the PRM and auth server default scopes. Per RFC 9728, PRM scopes_supported describes what the resource server needs (minimal: ["openid"]), while auth server scopes describe what the AS supports (["openid", "profile", "email", "offline_access"]). These are distinct concerns that should not share a single constant.

When the embedded auth server is configured, the config builder now propagates the AS's ScopesSupported to the PRM so clients discover the full set of supported scopes including offline_access. When using an external OIDC provider without explicit scopes, the PRM safely defaults to ["openid"].

Add integration tests verifying refresh token issuance with offline_access and its absence without it.

Fixes: #3776

@jhrozek
jhrozek requested a review from tgrunnagle February 11, 2026 21:57
@github-actions github-actions Bot added the size/M Medium PR: 300-599 lines changed label Feb 11, 2026
@codecov

codecov Bot commented Feb 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.78%. Comparing base (c8f2254) to head (d2f9e77).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3794   +/-   ##
=======================================
  Coverage   66.78%   66.78%           
=======================================
  Files         437      437           
  Lines       43002    43012   +10     
=======================================
+ Hits        28718    28727    +9     
- Misses      12078    12080    +2     
+ Partials     2206     2205    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

MCP clients like VS Code resolve OAuth scopes from the Protected
Resource Metadata (RFC 9728) scopes_supported field. When no explicit
scopes were configured, the PRM handler defaulted to ["openid"],
causing clients to never request offline_access and therefore never
receive refresh tokens.

Separate the PRM and auth server default scopes. Per RFC 9728,
PRM scopes_supported describes what the resource server needs (minimal:
["openid"]), while auth server scopes describe what the AS supports
(["openid", "profile", "email", "offline_access"]). These are distinct
concerns that should not share a single constant.

When the embedded auth server is configured, the config builder now
propagates the AS's ScopesSupported to the PRM so clients discover the
full set of supported scopes including offline_access. When using an
external OIDC provider without explicit scopes, the PRM safely defaults
to ["openid"].

Add integration tests verifying refresh token issuance with
offline_access and its absence without it.

Fixes: #3776
@jhrozek
jhrozek force-pushed the fix/prm-scope-defaults branch from 8405152 to d2f9e77 Compare February 11, 2026 22:59
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedded auth server: PRM and AS metadata advertise inconsistent scopes

2 participants