Skip to content

feat(auth): add enterprise refresh-token and ID-JAG exchanges - #1234

Draft
nicksteele-oai wants to merge 2 commits into
modelcontextprotocol:mainfrom
nicksteele-oai:dev/steele/ema-upstream
Draft

feat(auth): add enterprise refresh-token and ID-JAG exchanges#1234
nicksteele-oai wants to merge 2 commits into
modelcontextprotocol:mainfrom
nicksteele-oai:dev/steele/ema-upstream

Conversation

@nicksteele-oai

@nicksteele-oai nicksteele-oai commented Sep 1, 2026

Copy link
Copy Markdown

This PR adds the EMA/XAA token exchange flow behind auth-enterprise-managed: enterprise refresh token → ID-JAG → MCP access token. It covers the refresh-token portion of the request for support in #531.

Each authorization server has its own client authentication configuration. Clients can use a secret or a fresh JWT assertion from an application-provided signer. Public clients remain supported where explicitly allowed.

Scope

The exchange targets one MCP resource and preserves scope narrowing. The SDK checks ID-JAG structure and claim bindings. The resource authorization server verifies the signature.

Applications may supply approved server metadata and client registrations. Discovery, login, credential storage, automatic refresh, and reauth remain application responsibilities. JWT signing stays with the application. RAR and DPoP remain unsupported; nonempty authorization_details are rejected.

Testing

Local validation passed for revision dc26f27a8228:

  • 211 OAuth tests with all features on Rust 1.96.
  • 50 doctests passed; 10 ignored.
  • Rust 1.88 minimal-feature check passed (--no-default-features --features auth-enterprise-managed).
  • Formatting, strict rmcp Clippy (--all-targets --all-features), and commitlint passed.
  • The MCP connection example compiles with its documented features.

Tests use mocked responses and local HTTP fixtures.

Breaking Changes

None intended and existing OAuth behavior is unchanged.

@github-actions github-actions Bot added T-documentation Documentation improvements T-dependencies Dependencies related changes T-test Testing related changes T-config Configuration file changes T-core Core library changes T-transport Transport layer changes labels Sep 1, 2026
Redeem ID-JAGs at the approved resource authorization server and return
its bearer token, lifetime, and effective granted scopes. Preserve scope
narrowing and redacted diagnostics, and reuse the default HTTP adapter.

Support independently configured client authentication at both servers.
Document the exchange profile and test redirects and staged failures.

Partially addresses modelcontextprotocol#531.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-dependencies Dependencies related changes T-documentation Documentation improvements T-test Testing related changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant