Skip to content

StatelessAuthenticationMiddleware

Runs stateless firewalls’ authenticator chains (HTTP Basic, and — once packages/auth-jwt is installed — bearer/JWT) before routing and before Quiote\Middleware\SessionMiddleware, matching firewalls by request path.

Registered by AuthPlugin with an explicit before: Quiote\Middleware\SessionMiddleware::class anchor rather than relying on a bare phase/priority: MiddlewarePhase::ORDER places the bootstrap phase (where SessionMiddleware sits at priority 900) ahead of the pre_routing/pre phases unconditionally, so only an explicit edge guarantees this runs first — letting a machine-client token signal “no session” (via the auth.sessionless request attribute) before session startup.

final class StatelessAuthenticationMiddleware implements MiddlewareInterface

ImplementsMiddlewareInterface
Since1.0.0
SourceMiddleware/StatelessAuthenticationMiddleware.php

public function __construct(FirewallMap $firewalls, AuthenticationManager $manager): mixed

Runs the matched firewall’s authenticator chain.

ParameterTypeDescription
$firewallsFirewallMapThe configured firewalls, matched by request path.
$managerAuthenticationManagerRuns the matched firewall’s authenticator chain.

Returns mixed

MethodDescription
process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface

public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface

The next middleware in the pipeline.

ParameterTypeDescription
$requestServerRequestInterfaceThe incoming request.
$handlerRequestHandlerInterfaceThe next middleware in the pipeline.

Returns ResponseInterface — The next middleware’s response, or the firewall’s entry-point response on an invalid credential.