scheb/2fa-totp
TOTP (Time-based One-Time Password) provider for the scheb TwoFactorBundle, enabling app-based 2FA with authenticator codes. Part of the scheb/2fa project (read-only mirror); see main repo/docs for setup.
Auth::attempt(), guards) will require adaptation to work with TOTP logic, but the core TOTP algorithm (RFC 6238) is universally applicable.scheb/2fa-bundle, suggesting composability with other 2FA methods (e.g., SMS, backup codes). This aligns with Laravel’s modular design (e.g., service containers, providers).VerifyTotpMiddleware), but auth flow synchronization (e.g., Auth::login() vs. TOTP check) requires careful sequencing.secret, algorithm, and digits. Laravel’s migrations can adapt these, but backward compatibility with existing auth tables (e.g., users) may need custom logic.config/2fa.php) may require manual overrides.endroid/qr-code or Blade components for consistency.EventDispatcher, HttpFoundation) may not align with Laravel’s events, request lifecycle, or service container.spomky-labs/otp) and wrap it in Laravel-native services/middleware.LoginController). Poor implementation could lead to UX friction or security gaps (e.g., infinite retries).scheb/2fa repo may introduce breaking changes.Auth::attempt() without breaking existing flows?users table or create a dedicated totp_secrets table?symfony/http-foundation, symfony/routing, and adapt bundle logic.spomky-labs/otp) and build a Laravel-native package.composer.json can resolve these without conflicts.platform-check in composer.json or alias dependencies where needed.Authenticatable trait and Guard system must delegate to TOTP middleware.TotpGuard that extends Laravel’s SessionGuard or TokenGuard.scheb/2fa-totp and scheb/2fa-bundle in a new Laravel project.users table (e.g., totp_secret, totp_algorithm).TotpService to handle secret generation/verification.VerifyTotpMiddleware to check TOTP on protected routes.Auth::attempt() via event listeners (e.g., Attempting, Authenticated).endroid/qr-code).laravel-throttle).| Component | Compatibility | Workaround |
|---|---|---|
| Symfony Bundle | Low (Laravel is not Symfony) | Use Symfony Bridge or rewrite as Laravel package. |
| Database Schema | Medium (requires table extensions) | Create migrations to add TOTP fields. |
| Middleware | High (Laravel supports PSR-15 middleware) | Adapt bundle middleware to Laravel’s Handle interface. |
| Event System | Medium (Symfony Events vs. Laravel Events) | Map Symfony events to Laravel’s Illuminate\Events or use a facade. |
| Configuration | Low (Symfony’s YAML/XML vs. Laravel’s PHP) | Merge configs manually or use laravel/config. |
| QR Code Generation | High (can be extracted or replaced) | Use endroid/qr-code or bundle’s Symfony\Bundle\FrameworkBundle. |
scheb/2fa-totp, scheb/2fa-bundle, Symfony bridge packages).config/.TotpService to abstract bundle logic.How can I help you explore Laravel packages today?