Skip to content

AuthenticationManager

Runs a firewall’s authenticator chain against a request and, on success, populates the request’s SecurityUser/RbacSecurityUser.

AuthN only — the existing authZ path (SecurityService/SecurityMiddleware) is unchanged and runs independently afterward.

final class AuthenticationManager

Since1.0.0
SourceAuthenticationManager.php

public function __construct(Controller $controller): mixed

The owning context’s Controller, used to reach its SecurityUser.

ParameterTypeDescription
$controllerControllerThe owning context’s Controller, used to reach its SecurityUser.

Returns mixed

MethodDescription
authenticate(ServerRequestInterface $request, Firewall $firewall): ?PassportTries each of $firewall’s authenticators in declaration order and stops at the first one whose supports() matches $request.

public function authenticate(ServerRequestInterface $request, Firewall $firewall): ?Passport

Tries each of $firewall’s authenticators in declaration order and stops at the first one whose supports() matches $request.

The firewall matched for this request.

ParameterTypeDescription
$requestServerRequestInterfaceThe incoming request.
$firewallFirewallThe firewall matched for this request.

Returns ?Passport — The successful passport, or null if no authenticator supported this request.

ThrowsWhen
AuthenticationExceptionIf the matching authenticator’s credential was present but invalid.