Skip to content

Fix connector consent origin and blocked OAuth redirects - #61

Merged
aikhanjum merged 1 commit into
mainfrom
fix/course-consent-origin
Nov 26, 2026
Merged

aikhanjum merged 1 commit into
mainfrom
fix/course-consent-origin

Conversation

@aikhanjum

Copy link
Copy Markdown
Collaborator

Submitting the connector consent form in Chromium fails with Forbidden origin, leaving Claude disconnected. The page sets Referrer-Policy to no-referrer, which makes the browser send Origin as null on the form POST. After correcting that, the form-action policy also blocks the OAuth redirect back to the assistant.

This changes connector pages to same-origin referrer policy and adds only the registered HTTP(S) callback origin to the consent page's form-action policy. The connection management page keeps form-action restricted to self. Strict POST origin checks, PKCE, cookie binding, account binding, and optional write consent remain enforced.

Validation

  • npm run typecheck passed.
  • npm test passed, 73 tests with zero failures. Added coverage for callback policy injection and rejected null or missing origins.
  • npm run build and git diff --check passed.
  • Reproduced both browser failures locally. After the fix, isolated Chromium completed consent, returned to a separate callback origin, exchanged the PKCE code, accessed authenticated MCP, disconnected, and confirmed the revoked token was rejected.

The browser check used a local Miniflare worker and a test session, not a live Princeton sign-in or Claude account. Production still needs deployment and a fresh Claude connection attempt after merge. No deployment is included in this PR.

@aikhanjum
aikhanjum merged commit 81a462a into main Nov 26, 2026
1 check passed
@aikhanjum
aikhanjum deleted the fix/course-consent-origin branch November 26, 2026 05:40
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