Download the PHP package trilbdev/two-factor-library without Composer
On this page you can find all versions of the php package trilbdev/two-factor-library. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download trilbdev/two-factor-library
More information about trilbdev/two-factor-library
Files in trilbdev/two-factor-library
Package two-factor-library
Short Description A PHP 2FA library for TOTP, QR codes, passkeys, and recovery codes.
License MIT
Homepage https://trilb.dev/catalog/libraries/two-factor-library
Informations about the package two-factor-library
TwoFactorLibrary
A custom PHP library for two-factor authentication, WebAuthn-style passkeys, and backup recovery codes — built without depending on third-party 2FA libraries.
Features
- TOTP generation and validation
- QR code generation for otpauth URIs
- passkey registration and authentication helpers for WebAuthn-style server flows
- challenge-based credential creation and validation
- recovery-code generation and validation
- configurable TOTP options for digits, period, and hash algorithm
Installation
Composer autoloading
The package uses PSR-4 autoloading:
Main entry point
The library exposes a single entry point, TwoFactorAuthentication, which groups all modules:
An alias is also available:
Quick start: TOTP
Quick start: QR code generation
Quick start: recovery codes
Quick start: passkeys
This passes through the WebAuthn-style registration and assertion flow exposed by the passkey provider. The package also includes the original lightweight helper methods for challenge-based validation:
Requirements
- PHP 8.1+
- GD extension for QR generation
- OpenSSL for passkey signature verification when using the WebAuthn-style verification helpers
Documentation index
- Docs/README.md
- Docs/Totp.md
- Docs/QRCode.md
- Docs/Passkey.md
- Docs/Recovery.md