Skip to content

Add Apigee OAuth proxy for MCP in nonprod - #2130

Draft
keyurva wants to merge 4 commits into
datacommonsorg:masterfrom
keyurva:apigee-mcp-oauth
Draft

keyurva wants to merge 4 commits into
datacommonsorg:masterfrom
keyurva:apigee-mcp-oauth

Conversation

@keyurva

@keyurva keyurva commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
  • Added standalone oauth Apigee proxy (/api/oauth) implementing OAuth 2.0 authorization code flow with PKCE (S256), JWT bearer (urn:ietf:params:oauth:grant-type:jwt-bearer) streamlined account linking (check, get, create), token refresh, .well-known discovery metadata, and Google Sign-In identity verification.
  • Added /oauth/mcp route that verifies OAuth access tokens, enforces per-user rolling-window quota in Apigee, strips Authorization headers, and forwards requests to the Mixer ESP endpoint.
  • Updated deploy_apigee.sh, envs/nonprod.yaml, sample.env, and terraform/nonprod/main.tf to bundle JavaScript resources and register the oauth proxy and datacommons-oauth-staging product in datcom-apigee-dev.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an OAuth 2.0 Authorization Server facade and an OAuth-protected MCP proxy to the Apigee deployment, including new JavaScript resources, XML policy definitions, and Terraform configurations. The review feedback highlights several critical improvements: resolving a potential deployment script crash when parsing proxies without JavaScript resources, fixing a logic bug in redirect URI validation, handling CORS preflight (OPTIONS) requests locally to prevent authentication failures, utilizing a cryptographically secure random number generator for CSRF nonces instead of Math.random(), and adding a time allowance to the JWT verification policy to mitigate clock skew issues.

Comment thread deploy/apigee/deploy_apigee.sh Resolved
Comment thread deploy/apigee/proxy_endpoints/oauth.xml Resolved
Comment thread deploy/apigee/proxy_endpoints/oauth.xml Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant