pushinbr / nimbus-2fa
TOTP, recovery codes and passkeys (WebAuthn) for Nimbus logins.
Package info
pkg:composer/pushinbr/nimbus-2fa
Requires
- php: ^8.4
- pushinbr/arcano: ^0.2.9
- pushinbr/nimbus: ^0.8.1
- spomky-labs/otphp: ^11.4
Requires (Dev)
- bacon/bacon-qr-code: ^3.0
- phpunit/phpunit: ^11.5
- symfony/console: ^7.4 || ^8.0
- web-auth/webauthn-lib: ^5.3
Suggests
- bacon/bacon-qr-code: SVG QR codes of the otpauth:// enrollment URI (TotpEnrollment::qrSvg()).
- symfony/console: The two-factor:prune console command.
- web-auth/webauthn-lib: Passkeys (Nimbus\TwoFactor\Passkeys).
Provides
None
Conflicts
None
Replaces
None
README
TOTP, recovery codes and passkeys (WebAuthn) for Nimbus logins.
TOTP through spomky-labs/otphp (secrets encrypted with the application key, codes accepted
once per time step, constant-time comparison), single-use hashed recovery codes, a lockout
after repeated wrong codes, passkeys through web-auth/webauthn-lib (optional), and the
login challenge: TwoFactorLogin wraps the application's token issuer and TwoFactorRoutes
adds the /two-factor routes under the account routes.
Start here
Install PAM first (curl -fsSL https://push-in.github.io/pam/install.sh | sh), then
add the package to a Nimbus application (Nimbus 0.8.1 or later):
pam composer require pushinbr/nimbus-2fa
$login = new TwoFactorLogin($pairs, $container->get(TwoFactor::class)); (new AuthRoutes(tokens: $pairs, extensions: [new TwoFactorRoutes($login)]))->register($app, '/auth');
Documentation: docs/nimbus/dois-fatores.md.
Evaluated packages
Checked on Packagist on 2026-12-02 (downloads: total / last month).
| Package | Downloads | License | Latest | Decision |
|---|---|---|---|---|
spomky-labs/otphp |
61.9M / 3.2M | MIT | 11.5.1 (2026-11-07) | Used for TOTP (secret generation, otpauth:// URI, codes per time step). Takes a PSR-20 clock, which the replay check and the tests need. |
pragmarx/google2fa |
150M / 16.9M | MIT | 9.1.0 (2026-08-15) | Not used: equivalent TOTP, but no PSR clock and no per-step code API; otphp covers the same with fewer workarounds. |
scheb/2fa-totp |
5.0M / 546k | MIT | 8.9.0 (2026-11-28) | Not usable: requires scheb/2fa-bundle (Symfony bundle); it wraps otphp itself. |
web-auth/webauthn-lib |
42.9M / 10.4M | MIT | 5.3.17 (2026-11-23) | Used (suggested) for passkeys: attestation and assertion ceremonies, COSE keys, counters, backup flags. |
lbuchs/webauthn |
3.0M / 745k | MIT | 2.2.0 (2024-07-04) | Not used: no release since 2024 and a smaller verification surface. |
bacon/bacon-qr-code |
246M / 19.5M | BSD-2-Clause | 3.1.1 (2026-04-05) | Used (suggested) for the SVG QR code of the enrollment URI. |
Development
The package is developed in the push-in/pam
monorepo (packages/nimbus-2fa); push-in/nimbus-2fa is a read-only split. Its
tests share the runtime stubs and fixtures of packages/nimbus/tests:
scripts/nimbus-package-test.sh nimbus-2fa
License
Apache-2.0. See LICENSE.