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
EMA flow rejects access tokens that carry scopes the ID-JAG doesn't have #1480
P2Medium: important but non-blocking improvementT-securitySecurity-related changesbugSomething is not workingready for workIssue is well-defined and ready to be picked up
Describe the bug
In the Enterprise-Managed Authorization flow, the client redeems the ID-JAG at the resource authorization server. It then rejects the access token it gets back if the token's scope has any value the ID-JAG doesn't carry. Which scopes end up on the token is up to the AS, not the client. The check also breaks unscoped ID-JAGs: if the ID-JAG has no scope but the AS returns a scoped token, the exchange fails. Other MCP SDKs accept the scopes the AS returns.
To Reproduce
Steps to reproduce the behavior:
Run the EMA flow so the IdP issues an ID-JAG with scope: "files.read", or with no scope at all.
Have the resource AS answer the JWT bearer grant with a valid bearer token whose scope is "files.read files.write", or "files.read" when the ID-JAG had no scope.
The exchange fails with EmaError::InvalidResponse at the resource authorization server stage.
Expected behavior
The client accepts the token and reports the scopes the AS returned. Malformed scope values (duplicates, invalid characters) should still be rejected.
Additional context
The check is in crates/rmcp/src/transport/auth/enterprise.rs, where the bearer response is validated (access token scope exceeds ID-JAG scope). It probably exists to make sure scopes only get narrower, but that's doesn't apply for tokens returned by the AS.
P2Medium: important but non-blocking improvementT-securitySecurity-related changesbugSomething is not workingready for workIssue is well-defined and ready to be picked up
Activity
github-actions commentedon Nov 20, 2026
@michaelneale is on triage rotation this week and is the reviewer for this one.
Codex labeled this bug / P2 (T-security). Please confirm or correct those labels.
Automated triage. Labels are a first pass and the assigned maintainer has the final say.
docs(auth): describe AS-decided scope in EMA flow