ProtectedResourceMetadataHandler implements RequestHandlerInterface
FinalYes
Serves OAuth 2.0 Protected Resource Metadata (RFC 9728) as a standalone request handler.
This is a plain PSR-15 RequestHandlerInterface — the "controller" that decides what to return, independent of when. It can be used three ways from a single instance:
- inside the MCP transport, wrapped by ProtectedResourceMetadataMiddleware;
- as a bare PSR-7 handler in a hand-rolled front controller;
- as a framework callable controller (Symfony/Laravel), by converting the framework request to PSR-7 and the returned PSR-7 response back — see docs/run/authorization.md.
It performs no path or method matching: routing is the caller's responsibility (the middleware's guard, or the framework router).
Tags
Table of Contents
Interfaces
- RequestHandlerInterface
Properties
- $metadata : ProtectedResourceMetadata
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
Methods
- __construct() : mixed
- handle() : ResponseInterface
Properties
$metadata read-only
private
ProtectedResourceMetadata
$metadata
$responseFactory
private
ResponseFactoryInterface
$responseFactory
$streamFactory
private
StreamFactoryInterface
$streamFactory
Methods
__construct()
public
__construct(ProtectedResourceMetadata $metadata[, ResponseFactoryInterface|null $responseFactory = null ][, StreamFactoryInterface|null $streamFactory = null ]) : mixed
Parameters
- $metadata : ProtectedResourceMetadata
- $responseFactory : ResponseFactoryInterface|null = null
- $streamFactory : StreamFactoryInterface|null = null
handle()
public
handle(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface