Skip to content

Add scope parameter to WWW-Authenticate header#523

Merged
DaleSeo merged 2 commits intomainfrom
AIR-75
Dec 11, 2025
Merged

Add scope parameter to WWW-Authenticate header#523
DaleSeo merged 2 commits intomainfrom
AIR-75

Conversation

@DaleSeo
Copy link
Copy Markdown
Member

@DaleSeo DaleSeo commented Dec 5, 2025

Add support for optional scope parameter in the WWW-Authenticate header per MCP Auth Spec 2025-11-25.

When returning 401 Unauthorized responses, the server now includes the configured scopes to guide clients on appropriate scopes to request during authorization.

This PR extends the WwwAuthenticate::Bearer variant with an optional scope field. When scopes are configured, they are space-separated and included in 401 responses. When no scopes are configured, the parameter is omitted.

Testing

Before:

2025-12-05 at 16 42 34

After:

2025-12-05 at 16 27 53

@DaleSeo DaleSeo self-assigned this Dec 5, 2025
@DaleSeo DaleSeo requested a review from a team as a code owner December 5, 2025 21:44
@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian Bot commented Dec 5, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 05dd107dee3795ef1dea431c
Build Logs: View logs

Comment thread .changesets/feat_add_scope.md
@DaleSeo DaleSeo merged commit 2cdcb9a into main Dec 11, 2025
11 checks passed
@DaleSeo DaleSeo deleted the AIR-75 branch December 11, 2025 13:59
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