A PHP implementation of Google Authenticator-compatible two-factor authentication using HOTP and TOTP algorithms.
Google2FA is a PHP package that implements two-factor authentication compatible with Google Authenticator and other TOTP-based authenticator apps. It generates and validates one-time passwords using the HOTP and TOTP algorithms, providing an additional security layer for PHP applications. The package helps developers easily add 2FA to their login systems, user accounts, or sensitive operations.
PHP developers building web applications that require secure user authentication, particularly those needing to implement two-factor authentication without relying on external services.
Developers choose Google2FA because it's a pure PHP implementation that's fully compatible with Google Authenticator, follows RFC standards, and offers extensive customization options for key length, algorithms, and validation windows. It's lightweight, well-tested, and integrates easily with popular PHP frameworks like Laravel.
A One Time Password Authentication package, compatible with Google Authenticator.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements both HOTP (RFC 4226) and TOTP (RFC 6238) algorithms, ensuring reliable interoperability with authenticator apps and other systems.
Works seamlessly with popular TOTP apps like Authy and FreeOTP, as noted in the README's compatibility list, making user adoption straightforward.
Supports SHA1, SHA256, and SHA512 HMAC algorithms, adjustable key lengths (16 to 32 chars), and validation windows to handle clock drift.
Offers a dedicated Laravel bridge package for easy framework integration, simplifying setup for Laravel-based projects.
Includes validation windows and server time considerations to mitigate clock drift issues, improving reliability in real-world deployments.
Version 9.0.0 introduced a breaking change by increasing default key length to 32 characters, requiring database schema updates and code adjustments for existing systems.
Relies on external libraries like BaconQRCode or Simple QrCode for QR codes, adding dependency management and integration overhead.
Only supports time-based and counter-based one-time passwords, lacking native integration for other 2FA methods like SMS or biometric authentication.
Requires accurate server time synchronization via NTP to avoid validation failures, which can be a pain point in misconfigured or restricted environments.