fix: add client_credentials fallback for outbound token acquisition#152
Closed
mrsabath wants to merge 1 commit into
Closed
fix: add client_credentials fallback for outbound token acquisition#152mrsabath wants to merge 1 commit into
mrsabath wants to merge 1 commit into
Conversation
The go-processor outbound handler only supported token exchange (RFC 8693) which requires a valid subject_token from the outbound request Authorization header. When the agent does not forward a token (or forwards an invalid one), the exchange fails and the request reaches the tool without authentication. Add a clientCredentialsGrant() function that obtains a token using the OAuth 2.0 client_credentials grant as a fallback. The outbound handler now tries token exchange first, and if that fails (or no auth header is present), falls back to client_credentials using the agent registered SPIFFE ID client and secret. This enables end-to-end AuthBridge flows where agents do not forward inbound tokens on their outbound MCP requests. Part of: rossoctl/rossoctl#767 Signed-off-by: Mariusz Sabath <mrsabath@gmail.com> Made-with: Cursor
15 tasks
Contributor
Author
|
/run-e2e |
Member
|
@mrsabath is this going to be a temporary solution? When token exchange fails, and we fall back to the agent's own credentials to perform token exchange, this doesn't sound secure. |
mrsabath
marked this pull request as draft
February 27, 2026 22:25
Contributor
Author
|
Closing: superseded by #171 (merged Mar 6), which implemented the same client_credentials fallback for outbound token acquisition. |
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
clientCredentialsGrant()fallback: the outbound handler tries token exchange first, then falls back to OAuth 2.0 client_credentials grant using the agent's registered SPIFFE ID client credentialskagentirealmContext
Discovered during end-to-end testing of the realm migration (rossoctl/rossoctl#767). The git-issue-agent does not forward the inbound JWT on its outbound MCP requests to the GitHub tool. The go-processor saw no Authorization header and skipped token acquisition entirely, causing the tool to call GitHub's API without authentication.
The fallback flow is:
Test plan
envoy-with-processorimage to Kind cluster[Client Credentials] Successfully obtained token)Part of: rossoctl/rossoctl#767
Made with Cursor