Download the PHP package mincdev/php-otpauth without Composer
On this page you can find all versions of the php package mincdev/php-otpauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mincdev/php-otpauth
More information about mincdev/php-otpauth
Files in mincdev/php-otpauth
Package php-otpauth
Short Description PHP library for Time-based One-Time Password (TOTP) authentication compatible with Google Authenticator, Microsoft Authenticator and Authy.
License MIT
Informations about the package php-otpauth
PHP-OtpAuth
A lightweight PHP library for generating and validating Time-based One-Time Passwords (TOTP) compatible with Google Authenticator, Microsoft Authenticator, Authy, 1Password, Bitwarden, and other RFC 6238 compatible authenticator applications.
Features
- ๐ Generate cryptographically secure TOTP secrets
- ๐ฑ Generate QR codes for easy authenticator app provisioning
- โ Validate one-time passwords
- ๐งช Verified against the official RFC 6238 test vectors
- ๐ฅ๏ธ QR codes are generated locally on your server โ no secrets are sent to third-party services
- ๐ Lightweight with minimal dependencies
Installation
Install the package using Composer:
Generating a Secret and QR Code
The returned value is a Base64 data URI that can be used directly in an image tag:
Validating a Code
Security
This library generates QR codes entirely on your server. The user's secret is never transmitted to an external QR code generation service, ensuring that sensitive authentication data remains under your control.
QR code generation is powered by tc-lib-barcode.
Compatibility
This library implements RFC 6238 (TOTP) and works with applications such as:
- Google Authenticator
- Microsoft Authenticator
- Authy
- 1Password
- Bitwarden
- and other compatible authenticator apps.
Testing
The TOTP implementation is verified against the official RFC 6238 test vectors to ensure standards-compliant code generation.
Run the test suite with:
License
Released under the MIT License.