Repository navigation
feat(mcp): add generic workload token exchange grants - #305
Merged
Merged
Conversation
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.
Summary
Add generic RFC 8693 token exchange to MCP workload authentication while retaining RFC 7523 JWT bearer and issuer discovery as defaults. Both grants use the shared acquisition session, with optional audience, scope, and bounded non-secret extension parameters.
Technical details
Explicit endpoint trust
An opt-in explicit mode pins an operator-configured HTTPS token endpoint without requiring discovery. This mode accepts JWT source files up to 16 KiB; discovery keeps its 8 KiB limit and issuer-origin checks. MCP still binds its configured resource to the HTTPS server URL, while shared acquisition supports absolute resource URIs for other consumers.
Token handling
Token exchange requests an OAuth access token and requires a Bearer response with the corresponding issued token type. Missing exchange expiry disables caching instead of inventing a lifetime. Rotation-aware reads, serialized renewal, acquisition-specific invalidation, and the existing no-redirect, no-fallback, and no-MCP-replay behavior are preserved.