ClientRegistrationMiddleware implements MiddlewareInterface
FinalYes
OAuth 2.0 Dynamic Client Registration (RFC 7591) middleware.
Handles POST /register requests by delegating to a ClientRegistrarInterface and enriches /.well-known/oauth-authorization-server responses with the registration_endpoint.
Table of Contents
Interfaces
- MiddlewareInterface
Constants
- REGISTRATION_PATH = '/register'
Properties
- $localBaseUrl : string
- $registrar : ClientRegistrarInterface
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
Methods
- __construct() : mixed
- process() : ResponseInterface
- enrichAuthServerMetadata() : ResponseInterface
- handleRegistration() : ResponseInterface
- jsonResponse() : ResponseInterface
Constants
REGISTRATION_PATH
private
mixed
REGISTRATION_PATH
= '/register'
Properties
$localBaseUrl read-only
private
string
$localBaseUrl
$registrar read-only
private
ClientRegistrarInterface
$registrar
$responseFactory
private
ResponseFactoryInterface
$responseFactory
$streamFactory
private
StreamFactoryInterface
$streamFactory
Methods
__construct()
public
__construct(ClientRegistrarInterface $registrar, string $localBaseUrl[, ResponseFactoryInterface|null $responseFactory = null ][, StreamFactoryInterface|null $streamFactory = null ]) : mixed
Parameters
- $registrar : ClientRegistrarInterface
- $localBaseUrl : string
- $responseFactory : ResponseFactoryInterface|null = null
- $streamFactory : StreamFactoryInterface|null = null
process()
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface
Return values
ResponseInterfaceenrichAuthServerMetadata()
private
enrichAuthServerMetadata(ResponseInterface $response) : ResponseInterface
Parameters
- $response : ResponseInterface
Return values
ResponseInterfacehandleRegistration()
private
handleRegistration(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacejsonResponse()
private
jsonResponse(int $status, array<string, mixed> $data[, array<string, string> $extraHeaders = [] ]) : ResponseInterface
Parameters
- $status : int
- $data : array<string, mixed>
- $extraHeaders : array<string, string> = []