Skip to main content

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

ParameterTypeDescription
args{ authorizationServers: string[]; resource: string; }-
args.authorizationServersstring[]Authorization server issuer URIs that issue tokens for this resource.
args.resourcestringThe protected resource's identifier URI.

Returns

Middleware