Repository navigation
fix(den-api): accept CIMD clients listing unsupported grant types - #5467
Merged
Merged
Conversation
Claude's Client ID Metadata Document lists urn:ietf:params:oauth:grant-type:jwt-bearer next to authorization_code and refresh_token. @better-auth/cimd rejected the whole document, so connecting Claude to the MCP server failed with invalid_client since #5293 started advertising CIMD support. Patch the plugin to keep only the supported grant types before validation. Signed-off-by: Benjamin Shafii <[email protected]>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
benjaminshafii
deleted the
fix/den-api-cimd-ignore-unsupported-grants
branch
September 30, 2026 00:18
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this about?
Connecting Claude to the OpenWork MCP server works again.
What problem does it solve?
Adding the OpenWork MCP connector in Claude failed with
invalid_client: grant_types must be a subset of ["authorization_code", "refresh_token"].What was the situation before?
Since #5293, Den advertises Client ID Metadata Document (CIMD) support, so Claude sends its CIMD URL as
client_idinstead of registering dynamically. Claude's document also listsurn:ietf:params:oauth:grant-type:jwt-bearer, and@better-auth/cimdrejects the whole document when it sees a grant type it doesn't support.How is this implemented?
patches/@[email protected]: right after the metadata document is parsed, drop grant types the plugin does not support and keep the supported ones. A document with no supported grant type is still rejected. Every other validation is unchanged.pnpm-workspace.yamlpatchedDependencies, next to the existing better-auth patches.What else changed?
none
Release note
Connecting Claude to OpenWork through the MCP connector no longer fails with an
invalid_clientgrant_types error.Evidence
No E2E.
ee/apps/den-api/test/mcp-oauth-cimd.test.tsadds a test that uses Claude's published document verbatim. Without the patch it fails with the grant_types error. With the patch, authorize redirects to consent and the client is stored with["authorization_code","refresh_token"]. 9/9 pass.