feat(auth): add enterprise refresh-token and ID-JAG exchanges - #1234
Draft
nicksteele-oai wants to merge 2 commits into
Draft
feat(auth): add enterprise refresh-token and ID-JAG exchanges#1234nicksteele-oai wants to merge 2 commits into
nicksteele-oai wants to merge 2 commits into
Conversation
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.
nicksteele-oai
force-pushed
the
dev/steele/ema-upstream
branch
from
September 2, 2026 02:13
85761f8 to
dc26f27
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_detailsare rejected.Testing
Local validation passed for revision
dc26f27a8228:--no-default-features --features auth-enterprise-managed).--all-targets --all-features), and commitlint passed.Tests use mocked responses and local HTTP fixtures.
Breaking Changes
None intended and existing OAuth behavior is unchanged.