Skip to content

Conversation

@mattzcarey
Copy link
Contributor

  • Implemented audience claim validation for access tokens according to RFC 7519 Section 4.1.3
  • Added support for resource parameter handling (RFC 8707) in token requests
  • Extended Token interface to include optional audience field for single or multiple values

Follows the MCP spec as far as I can see.

- Implemented audience claim validation for access tokens according to RFC 7519 Section 4.1.3
- Added support for resource parameter handling (RFC 8707) in token requests
- Extended Token interface to include optional audience field for single or multiple values
- Added comprehensive test suite for audience validation scenarios including:
  - Single audience validation
  - Multiple audience validation
  - Backward compatibility for tokens
@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2025

🦋 Changeset detected

Latest commit: f227b5e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/workers-oauth-provider Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mattzcarey mattzcarey marked this pull request as draft November 4, 2025 12:17
@mattzcarey
Copy link
Contributor Author

mattzcarey commented Nov 4, 2025

I reread the spec. There is more here I need to add

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/workers-oauth-provider/@cloudflare/workers-oauth-provider@103

commit: f227b5e

@mattzcarey mattzcarey marked this pull request as ready for review November 4, 2025 15:03
@mattzcarey mattzcarey requested review from kentonv, threepointone and whoiskatrin and removed request for kentonv and threepointone November 4, 2025 15:34
@mattzcarey mattzcarey changed the title feat: add audience validation for OAuth tokens per RFC 7519 Resource parameter handling and matching audience validation Nov 4, 2025
@threepointone threepointone merged commit 818a557 into main Nov 6, 2025
4 checks passed
@threepointone threepointone deleted the resource-parameter branch November 6, 2025 18:48
@threepointone threepointone mentioned this pull request Nov 6, 2025
threepointone added a commit that referenced this pull request Nov 7, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @cloudflare/workers-oauth-provider@0.1.0

### Minor Changes

- [#103](#103)
[`818a557`](818a557)
Thanks [@mattzcarey](https://github.com/mattzcarey)! - feat: add
audience validation for OAuth tokens per RFC 7519

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@matijagrcic
Copy link

Can the #109 #108 be merged? Without this you need to do "hacks" for ChatGPT and MCPJam to work, the hack being stripping the resource parameter to skip audience validation entirely with token interception in index.ts and resource clearing in he handler.ts.

@threepointone

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.

3 participants