sonata-project/google-authenticator
Authenticatable traits.GoogleAuthenticator class handles secret generation, QR code creation, and token validation.paragonie/googleauthenticator (a maintained fork) for core logic, adding indirect dependency risk.Illuminate\Auth hooks).egulias/secure-password, php-mfa/otp)?GoogleAuthenticator to Laravel’s container.$this->app->singleton(GoogleAuthenticator::class, function () {
return new GoogleAuthenticator();
});
Hash facade for secure secret storage (e.g., hashed in users table).simple-qrcode or Laravel’s Html helpers.secret_key column (encrypted if sensitive).AuthenticatesUsers trait to include TOTP checks.public function handle($request, Closure $next) {
if (!$request->user()->isMfaVerified()) {
return redirect()->route('mfa.verify');
}
return $next($request);
}
secret_key (string) and mfa_verified (boolean) to users table.json column for backup codes if adding later.paragonie/googleauthenticator (v11+) is required; pin version in composer.json.Illuminate/Hash and Illuminate/Support are up to date.paragonie/googleauthenticator updates).secret_key lookups is negligible.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package stops working | Broken MFA for all users | Fork + maintain locally |
| Database corruption | Lost secrets → locked accounts | Regular backups + encrypted storage |
| Time sync drift | Token validation failures | Educate users + implement grace period |
| Dependency vulnerability | Exploitable auth bypass | Pin versions + monitor CVE databases |
InvalidCodeException).How can I help you explore Laravel packages today?