request.redactedHeaderNames is empty here —
the verifier is the credential-handling code). Return an AccessToken to
admit the request. The result becomes ctx.auth, feeds per-item auth
checks and list filtering, and its token (hashed) keys response-cache
partitioning. token MUST therefore be a stable, non-empty, per-identity
value, such as the verified user id. The server rejects an empty token
with HTTP 500. Throw AuthorizationError to produce 403; any other throw
produces 401.
SECURITY: request headers are forgeable by anyone who can reach this server
directly. Trust them only after verifying provenance: a shared secret the
proxy injects, mTLS, or network isolation. Add your provenance-secret
header to FastMCPOptions.http.redactHeaders so it never surfaces in
ctx.http. See docs: servers/auth/trusted-proxy.
HTTP transports only. On stdio there is no HTTP request; configure a
TokenVerifier if you need FASTMCP_CLI_AUTH_TOKEN support.
Methods
verifyRequest()
Parameters
request
HttpRequestContext
Returns
Promise<AccessToken>