{"record":{"id":"0f0cd366495938af","repo":"symfony/symfony","slug":"unable-to-find-an-authenticator-named-s-for-the","errorCode":null,"errorMessage":"Unable to find an authenticator named \"%s\" for the firewall \"%s\". Available authenticators: \"%s\".","messagePattern":"Unable to find an authenticator named \"(.+?)\" for the firewall \"(.+?)\"\\. Available authenticators: \"(.+?)\"\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Bundle/SecurityBundle/Security.php","lineNumber":262,"sourceCode":"            $authenticatorIds = array_filter(array_keys($firewallAuthenticatorLocator->getProvidedServices()), static fn (string $authenticatorId) => $authenticatorId !== \\sprintf('security.authenticator.remember_me.%s', $firewallName));\n            if (!$authenticatorIds) {\n                throw new LogicException(\\sprintf('No authenticator was found for the firewall \"%s\".', $firewallName));\n            }\n            if (1 < \\count($authenticatorIds)) {\n                throw new LogicException(\\sprintf('Too many authenticators were found for the current firewall \"%s\". You must provide an instance of \"%s\" to login programmatically. The available authenticators for the firewall \"%s\" are \"%s\".', $firewallName, AuthenticatorInterface::class, $firewallName, implode('\" ,\"', $authenticatorIds)));\n            }\n\n            return $firewallAuthenticatorLocator->get($authenticatorIds[0]);\n        }\n\n        if ($firewallAuthenticatorLocator->has($authenticatorName)) {\n            return $firewallAuthenticatorLocator->get($authenticatorName);\n        }\n\n        $authenticatorId = 'security.authenticator.'.$authenticatorName.'.'.$firewallName;\n\n        if (!$firewallAuthenticatorLocator->has($authenticatorId)) {\n            throw new LogicException(\\sprintf('Unable to find an authenticator named \"%s\" for the firewall \"%s\". Available authenticators: \"%s\".', $authenticatorName, $firewallName, implode('\", \"', array_keys($firewallAuthenticatorLocator->getProvidedServices()))));\n        }\n\n        return $firewallAuthenticatorLocator->get($authenticatorId);\n    }\n}\n","sourceCodeStart":244,"sourceCodeEnd":268,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Bundle/SecurityBundle/Security.php#L244-L268","documentation":"Thrown by `Security::getAuthenticator()` when an `$authenticatorName` was passed but it matches neither a service in the firewall's authenticator locator directly nor the prefixed `security.authenticator.<name>.<firewall>` id. The exception lists all authenticators actually registered for that firewall to guide the fix.","triggerScenarios":"Calling `$security->login($user, 'api_key')` when no authenticator named `api_key` exists for the firewall. Line 255-263 first tries the raw name, then the prefixed id, then throws.","commonSituations":"Passing the authenticator's PHP class name when it's registered under a different short name, or vice versa. Renaming an authenticator service without updating the `login()` call. Typo in the authenticator name.","solutions":["Read the exception's \"Available authenticators\" list and pass one of those exact names.","Use the authenticator's service id / class FQCN if that's how it's registered: `$security->login($user, App\\Security\\ApiKeyAuthenticator::class);`.","Make sure the authenticator is actually registered on the target firewall (tagged/configured under it)."],"exampleFix":"// before\n$security->login($user, 'api_key');\n// after\n$security->login($user, App\\Security\\ApiKeyAuthenticator::class);","handlingStrategy":"validation","validationCode":"// Validate the authenticator name against registered ones before login:\n$available = $container->get('security.authenticators.manifest') ?? []; // project-specific source\nif (!in_array($authenticatorName, $available, true)) {\n    throw new \\InvalidArgumentException(sprintf('Unknown authenticator \"%s\".', $authenticatorName));\n}\n$security->login($user, $authenticatorName, $firewallName);","typeGuard":null,"tryCatchPattern":"try {\n    $security->login($user, $authenticatorName, $firewallName);\n} catch (\\Symfony\\Component\\Security\\Core\\Exception\\LogicException $e) {\n    if (preg_match('/Available authenticators: \"(.+)\"/', $e->getMessage(), $m)) {\n        $first = explode('\", \"', $m[1])[0];\n        $security->login($user, $first, $firewallName);\n    } else { throw $e; }\n}","preventionTips":["Use the authenticator's FQCN as the name to avoid ambiguity.","Keep authenticator names stable; update login() calls when renaming.","Read the exception's available-authenticators list to fix typos fast."],"tags":["security","runtime","authenticator","login"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}