You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2527cba
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/_server/authorization.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,8 +282,10 @@ and never cached on the MCP session, so token expiry takes effect mid-session; r
282
282
which `IntrospectionVerifier` does on every request, while a locally validated JWT stays accepted until it expires.
283
283
284
284
`require_scopes!` raises `MCP::Server::OAuth::InsufficientScopeError`, which the server turns into a JSON-RPC invalid-request error (`-32600`)
285
-
whose `data` names the missing scopes; the HTTP status stays 200 and no `WWW-Authenticate` challenge is sent,
285
+
whose `data` names the missing scopes, and no `WWW-Authenticate` challenge is sent,
286
286
because step-up challenges (403 `insufficient_scope`) are the job of the transport-level `required_scopes:` gate.
287
+
The HTTP status is the one the transport gives every `-32600`: 200 on the legacy path and on a modern response streamed as SSE,
288
+
400 on a modern response returned as JSON.
287
289
The Python and TypeScript SDKs split endpoint-level challenges from in-handler authorization the same way.
288
290
Without bearer authentication `auth_info` is `nil` and `require_scopes!` fails closed.
289
291
Use it where one operation needs more than the endpoint as a whole:
@@ -324,7 +326,7 @@ and `scope` when `required_scopes:` is set or the metadata document advertises `
324
326
|`Bearer` header not carrying exactly one token | 400 `error="invalid_request"`|
325
327
| Valid token used against a session initialized by another principal | 404 as for an unknown session |
326
328
| Verifier raised anything outside the `OAuth::Error` hierarchy (JWKS or introspection endpoint down) | 500 without a challenge, reported through the exception reporter |
327
-
|`require_scopes!` failure inside a handler | JSON-RPC `-32600` in the normal 200 response, no HTTP challenge|
329
+
|`require_scopes!` failure inside a handler | JSON-RPC `-32600`, no HTTP challenge; 200 on the legacy path, 400 on a modern JSON response|
0 commit comments