Skip to content

fix(site): disable checkOrigin CSRF block on OAuth token endpoint and allow OIDC scopes - #730

Merged
codercatdev merged 1 commit into
devfrom
fix/mcp-oauth-csrf-and-scopes
Oct 13, 2026
Merged

codercatdev merged 1 commit into
devfrom
fix/mcp-oauth-csrf-and-scopes

Conversation

@codercatdev

Copy link
Copy Markdown
Contributor

Fixes three production issues found in live D1 and curl forensics during Google Gemini Account Linking:

  1. Disable Astro security.checkOrigin so server-to-server application/x-www-form-urlencoded POST /oauth2/token requests without an Origin header are not rejected with HTTP 403 Cross-site POST form submissions are forbidden.
  2. Include standard OIDC scopes (openid, profile, email, offline_access) in MCP_DEFAULT_SCOPES, clientRegistrationDefaultScopes, and D1 oauthClient.scopes so /oauth2/token does not fail with 400 invalid_scope (client does not allow scope openid).
  3. Add RFC 9728 / RFC 8414 subpath discovery routes (/.well-known/oauth-protected-resource/mcp, /.well-known/oauth-authorization-server/mcp, /.well-known/openid-configuration/mcp).

@codercatdev
codercatdev merged commit ec0324b into dev Oct 13, 2026
@codercatdev
codercatdev deleted the fix/mcp-oauth-csrf-and-scopes branch October 13, 2026 21:43
@github-actions

Copy link
Copy Markdown

⚡ Cloudflare Worker Preview Ready!

Environment URL
PR Preview https://4723d6a0-codingcatdev-dev.codingcatdev.workers.dev
Dev Custom Domain https://dev.codingcat.dev
  • Worker Version ID: 4723d6a0-e3e1-46cf-b48b-4f95bc2bc723
  • Protection: Restricted to @codingcat.dev accounts via Cloudflare Zero Trust Access

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