Skip to content

HttpChallengeEntryPoint

The entry point for stateless (token/Basic) firewalls: a 401 RFC 9457 Problem Details body plus a WWW-Authenticate challenge, matching Quiote\Mcp\Middleware\McpAuthMiddleware’s existing shape so API clients see one consistent failure format across the framework.

final class HttpChallengeEntryPoint implements EntryPointInterface

ImplementsEntryPointInterface
Since1.0.0
SourceEntryPoint/HttpChallengeEntryPoint.php

public function __construct(string $scheme = 'Bearer', ?string $realm = null): mixed

An optional realm parameter to include in the challenge.

ParameterTypeDescription
$schemestringThe WWW-Authenticate scheme (e.g. Bearer, Basic).
$realm?``stringAn optional realm parameter to include in the challenge.

Returns mixed

MethodDescription
start(ServerRequestInterface $request, AuthenticationException $exception): ResponseInterface

public function start(ServerRequestInterface $request, AuthenticationException $exception): ResponseInterface

The exception the failing authenticator threw.

ParameterTypeDescription
$requestServerRequestInterfaceThe request that failed authentication.
$exceptionAuthenticationExceptionThe exception the failing authenticator threw.

Returns ResponseInterface — A 401 response with a WWW-Authenticate header and an RFC 9457 Problem Details body.