Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: respect scope from WWW-Authenticate header and Protected Resourc…
…e Metadata

Implements proper scope selection priority per MCP OAuth spec:
1. Explicit scope parameter (user override)
2. WWW-Authenticate challenge scope (authoritative per spec)
3. Protected Resource Metadata scopes_supported
4. Client default scope

Changes:
- Add extractChallengeScope() to parse scope from WWW-Authenticate header
- Add selectScopes() helper with priority logic
- Update auth(), authInternal() to accept and use challengeScope
- Update SSE, StreamableHTTP, and middleware transports to extract and pass challenge scope
- Add comprehensive tests for extractChallengeScope() and scope selection priority

All 869 tests passing.
  • Loading branch information
cbcoutinho committed Oct 25, 2025
commit c0fbfd0310779ecdb3af6b8c8b7f738aa7c2c4bd
Loading
Loading