fix: accept the issuer with or without a trailing slash #17

Merged
jknapp merged 1 commits from fix/issuer-trailing-slash into main 2026-07-27 13:42:32 +00:00
Owner

Regression from OIDC_ISSUER_MCP: the stripped issuer was reused for the exact-match iss claim check.

🤖 Generated with Claude Code

Regression from OIDC_ISSUER_MCP: the stripped issuer was reused for the exact-match iss claim check. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jknapp added 1 commit 2026-07-27 13:42:31 +00:00
Regression introduced with OIDC_ISSUER_MCP. mcpIssuer() stripped the trailing
slash — right for building the JWKS URL, wrong for the `iss` claim check,
which jose compares by exact string. Authentik emits
`.../application/o/shared-memory-mcp/` with the slash, so verification failed
with "claim invalid: iss" even though issuer and audience were both correct.

Before OIDC_ISSUER_MCP the issuer was passed to jwtVerify unstripped and only
stripped when constructing the URL; collapsing both onto the stripped form is
what broke it.

mcpIssuer() now returns the value as configured, the JWKS URL strips locally,
and the claim check accepts both spellings so correctness doesn't hinge on
whether someone typed a trailing slash into an env var.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jknapp merged commit fc0cb453d3 into main 2026-07-27 13:42:32 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cybercove-labs/shared-memory#17