Skip to content

fix: accept OAuth tokens of clients that send no resource - #15

Merged
LucaB01 merged 2 commits into
mainfrom
fix/oauth-token-without-resource
Dec 1, 2026
Merged

LucaB01 merged 2 commits into
mainfrom
fix/oauth-token-without-resource

Conversation

@LucaB01

@LucaB01 LucaB01 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Problem

A client that sends no OAuth `resource` (seen with Microsoft Copilot Studio) signs in fine, but the Server then signs its token with the issuer as audience. The MCP server only accepted its own URLs, so every call got a 401 (`unexpected "aud" claim value`).

Fix

`verifyGleapJwt` also accepts the issuer (`GLEAP_AUTH_ISSUER`) as audience. Signature, issuer, expiry, `RS256` and the project claims are checked as before.

Safety

  • No new access: the token already carries the project key in readable form, and the API checks that key on every call.
  • EU and US have different issuers, so a token of one region is still refused in the other.
  • Looser than the MCP spec, on purpose: general Gleap tokens pass, including other OAuth clients that send no `resource`.
  • Auth change (`AGENTS.md`, "Stop and ask"): approved by Luca.

Checks

  • New test: failed with the 401 before the fix, passes now (a tool call reaches Gleap with the token's key and project). It is in its own commit.
  • `npm run typecheck`, `npm test`, `npm run build` and `npm run quality` pass locally.
  • Not tested with a real Copilot Studio.

🤖 Generated with Claude Code

LucaB01 and others added 2 commits December 1, 2026 11:19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LucaB01
LucaB01 merged commit 652700c into main Dec 1, 2026
2 checks passed
@LucaB01
LucaB01 deleted the fix/oauth-token-without-resource branch December 1, 2026 10:23
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.

2 participants