halloverden/symfony-authenticator-restrictor-bundle
A Symfony bundle for restricting which authenticators are available in your application. Configure rules to control when specific authentication methods can be used, giving fine-grained control over login flows without custom security code.
/api" is to split the Symfony firewall by route pattern. That's a heavyweight architectural commitment — split firewalls duplicate context, remember_me, logout, and access-control config, and break shared sessions across them. This bundle reframes the decision as "keep one firewall, scope the authenticator by route." That reframing — not the code — is the primary thing worth evaluating./app while /legacy keeps the old one. If a roadmap item is "modernize sign-in," this is a genuine de-risking lever that shortens the migration window and reduces the rollback surface.POST, or token authenticators that throw on non-API paths, generate bugs that present as routing problems but are actually authenticator-ordering problems. If support tickets or QA cycles are being burned here, this is a narrow-blast-radius fix.AuthenticatorInterface decorator, plausibly under ~100 lines. Against 0 stars, 0 dependents, and no visible release or maintenance signal, "buy" really means "vendor an unmaintained dependency into the authentication path." A PM should treat the pattern as the deliverable and the package as a reference implementation to read.One decision this does not support: anything on a Laravel codebase. Despite being a PHP package, this is a Symfony bundle that hooks the post-5.3 AuthenticatorInterface pipeline. Laravel's guard drivers, auth:<guard> middleware, and per-route-group selection already express this constraint declaratively. For a Laravel-first portfolio, the correct product decision is "note the pattern, do not adopt."
Consider it only when all of the following hold:
auth:<guard> middleware.pattern, a custom RequestMatcher, entry_point, security.access_control, or per-route IS_AUTHENTICATED_* rules don't cover the constraint, and expressing it natively forces a firewall split you don't want.Look elsewhere or solve in-house when:
pattern or a custom RequestMatcher already solves it. Prefer native config every time — supported, documented, survives upgrades.For executives. We have a recurring class of problem where our login mechanisms interfere with each other, because Symfony applies every configured authenticator to every request in a firewall. The clean native fix is splitting our security configuration into separate firewalls — a costly refactor that duplicates config and breaks shared sessions. A small community bundle offers a narrower option: keep one firewall, scope each login mechanism to the routes it belongs to. That would let us add modern sign-in (passkeys, SSO) to new pages without a big-bang migration and without touching legacy routes. Recommendation: treat the technique as the valuable part, not the artifact. Have engineering spend roughly a day implementing the decorator first-party rather than pulling a dependency with no users and no maintenance track record into our authentication path. If we do adopt, pin it, review the source, assign an owner, and log the fork plan as a known risk.
For engineering. It's a Symfony bundle — not a Laravel package — that constrains which authenticators run on which routes within a firewall. Mechanically it's a DI extension plus a compiler pass that decorates authenticator service definitions with a request matcher: small surface area, low functional risk, but it sits in the highest-consequence code path we have and is unmaintained by any external signal (0 stars, 0 dependents, unknown CI, bus factor of one). Suggested path: read the source, prototype the decorator behind a feature flag, and only take the dependency if our version proves worse than theirs. Before any adoption, answer: what exactly is matched (route name vs. path regex vs. compound), and what happens when nothing matches — suppression or permission? Test the negative case explicitly, since an auth bypass or a lockout both stem from getting the unmatched default wrong. Then pin the exact version, add an integration matrix across every authenticator × route pair, and register the fork plan in the risk log. Realistic ongoing cost is a few hours a year, spiking to a day or two at each Symfony major upgrade.
How can I help you explore Laravel packages today?