Skip to content

Drop confidential-client support (closes I-1)#25

Merged
stevepridemore merged 0 commit into
mainfrom
drop-confidential-clients
May 9, 2026
Merged

Drop confidential-client support (closes I-1)#25
stevepridemore merged 0 commit into
mainfrom
drop-confidential-clients

Conversation

@stevepridemore
Copy link
Copy Markdown
Owner

Summary

The server advertised client_secret_basic and client_secret_post in discovery metadata and generated a random client_secret for confidential registrations — but /oauth/token never actually verified it. The whole path was dead code that misadvertised a feature it didn't deliver.

This PR closes finding I-1 by removing the path entirely rather than building out hashing + verification for a feature with no current consumer.

  • registerClient throws InvalidClientMetadataError for any token_endpoint_auth_method other than "none"
  • /oauth/register catches it and returns 400 invalid_client_metadata
  • RegisteredClient.client_secret field removed
  • RegisteredClient.token_endpoint_auth_method narrowed to "none"
  • Discovery metadata advertises ["none"] only
  • Future-enhancements note added to docs/REMOTE.md covering the deferred server-to-server / machine-to-machine case (requires client_credentials grant + hashed secrets + verification, all together)

All real clients (claude.ai web, Claude Desktop, Claude Code) already use PKCE + token_endpoint_auth_method=none, which became mandatory in #18. No on-disk migration is needed.

Test plan

  • npm run build clean
  • npx vitest run src/shared/oauth.test.ts — 49 passing (7 new for the new "confidential clients no longer supported" describe block)
  • Existing tests updated to match new reality (Neo4j-dependent failures pre-exist and are unrelated)
  • Deploy and verify curl -sk https://graph-memory.doublec.biz/.well-known/oauth-authorization-server | jq .token_endpoint_auth_methods_supported returns ["none"]
  • Verify POST /oauth/register with "token_endpoint_auth_method": "client_secret_basic" returns 400 invalid_client_metadata
  • Reconnect claude.ai web connector, confirm normal flow still works (regression check on the happy path)

🤖 Generated with Claude Code

@stevepridemore stevepridemore merged this pull request into main May 9, 2026
2 checks passed
@stevepridemore stevepridemore deleted the drop-confidential-clients branch May 9, 2026 19:16
stevepridemore added a commit that referenced this pull request May 10, 2026
The server advertised client_secret_basic and client_secret_post in
discovery metadata, generated a random client_secret for confidential
registrations, and stored it plaintext in clients.json — but never
actually verified the secret at /oauth/token. The entire confidential
path was dead code that misadvertised a feature it didn't deliver.

Fix the misadvertisement by removing the path entirely:
  - registerClient throws InvalidClientMetadataError for any
    token_endpoint_auth_method other than "none"
  - /oauth/register catches it and returns 400 invalid_client_metadata
  - RegisteredClient.client_secret field removed
  - RegisteredClient.token_endpoint_auth_method narrowed to "none"
  - Discovery metadata advertises ["none"] only

All real clients (claude.ai web, Claude Desktop, Claude Code) already
use PKCE + token_endpoint_auth_method=none, which became mandatory in
PR #18. No on-disk migration is needed: existing clients.json entries
are all "none" already, and any stray client_secret strings will be
ignored at runtime since nothing reads them anymore.

If server-to-server / machine-to-machine clients are wanted in the
future, they should be re-introduced as one coherent feature:
client_credentials grant + hashed client_secret + verification +
re-advertised metadata. See docs/REMOTE.md for the deferred design
note.

Closes finding I-1 from docs/internal/THREAT-MODEL.md.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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