Function: createProtectedResourceMetadataMiddleware()
createProtectedResourceMetadataMiddleware(
args):Middleware
Defined in: http-server-auth/src/oauthServer.ts:105
Koa middleware that serves the RFC 9728 Protected Resource Metadata
document. Mount it before authMiddleware so the discovery endpoint
stays unauthenticated (clients fetch it before they have a token).
It answers at every location protectedResourceMetadataPaths derives for
the resource: the root, plus the path-derived location of RFC 9728 §3.1 when
the resource identifier carries a path.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { authorizationServers: string[]; resource: string; } | - |
args.authorizationServers | string[] | Authorization server issuer URIs that issue tokens for this resource. |
args.resource | string | The protected resource's identifier URI. |
Returns
Middleware