Skip to content

Allow hosts to verify opaque OAuth access tokens - #48

Merged
elsheppo merged 2 commits into
mainfrom
feat/opaque-oauth-verifier
Sep 25, 2026
Merged

elsheppo merged 2 commits into
mainfrom
feat/opaque-oauth-verifier

Conversation

@elsheppo

Copy link
Copy Markdown
Owner

Why

OAuth mode verifies every bearer as a Supabase user JWT. An application that runs its own OAuth authorization server issues opaque access tokens bound to its MCP resource, and Chumbo could not authenticate them. Using such a token as a Supabase user credential would also be wrong.

What changed

  • auth: { mode: "oauth", issuer, verify } accepts an optional verifier. Chumbo calls verify({ token, resourceUrl, issuer }) with the canonical resource URL and configured issuer.
  • A verifier requires an explicit issuer, which protected-resource metadata advertises.
  • Chumbo rejects a missing subject, a non-integer or past expiry, and a blank client ID.
  • Verified callers get an anonymous request-scoped Supabase client with no user claims. The opaque bearer is never sent to Supabase.
  • Omitting verify keeps Supabase JWT verification unchanged.
  • Docs explain who checks what, and the package is versioned as 0.12.2.

Safety boundary

The verifier owns issuer, exact resource, expiry, and revocation checks. Handlers for these callers cannot rely on Supabase RLS; capability code enforces application permissions, as it already does for API-key callers.

Verification

  • pnpm check: 220 passed, 3 skipped; build, packed artifact, branded CLI, and generated-project checks passed
  • pnpm format:check
  • npm pack --dry-run: 68-file chumbo@0.12.2 artifact

OAuth mode verified every bearer as a Supabase user JWT, so an application running its own OAuth authorization server could not accept the opaque, resource-bound access tokens it issues to MCP clients.

An optional verifier now receives the token with the canonical MCP resource URL and configured issuer, and owns issuer, exact resource, expiry, and revocation checks. This mode requires an explicit issuer. Chumbo rejects a missing subject or past expiry and gives handlers an anonymous Supabase client, so the opaque bearer never becomes a Supabase user token. Without a verifier, Supabase JWT verification is unchanged.

Verified with pnpm check and pnpm format:check.
Publish the application-owned OAuth verifier under 0.12.2, keeping package metadata, runtime version, specification, and changelog aligned.

Verified with pnpm check, pnpm format:check, and npm pack --dry-run.
@elsheppo
elsheppo merged commit b3afc7e into main Sep 25, 2026
4 checks passed
@elsheppo
elsheppo deleted the feat/opaque-oauth-verifier branch September 25, 2026 20:12
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