Download the PHP package yoolo-mine/google-authenticator without Composer
On this page you can find all versions of the php package yoolo-mine/google-authenticator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yoolo-mine/google-authenticator
More information about yoolo-mine/google-authenticator
Files in yoolo-mine/google-authenticator
Package google-authenticator
Short Description Google Authenticator 2FA library (forked and optimized from PHPGangsta).
License MIT
Homepage https://github.com/yoolo-mine/google-authenticator
Informations about the package google-authenticator
Google Authenticator PHP Class / PHP 谷歌身份验证器类
A PHP library to interact with Google Authenticator for 2FA.
本 PHP 库用于与 Google Authenticator 移动应用交互,实现双因素认证 (2FA)。
It can generate secrets, generate and verify codes, and provide QR-Code URIs. Implements TOTP according to RFC6238.
它可以生成密钥、生成和验证验证码,并提供二维码 URI。遵循 TOTP 标准 RFC6238。
Features / 功能
- Generate and verify TOTP codes / 生成和验证 TOTP 验证码
- QR-Code URI generation / 生成二维码 URI
- Customizable code length (default: 6) / 可自定义验证码长度(默认 6 位)
- Compatible with Google Authenticator, Authy, 1Password, etc. / 兼容 Google Authenticator、Authy、1Password 等 2FA 应用
- Includes PHPUnit test cases / 内置 PHPUnit 单元测试
Installation / 安装
Use Composer:
使用 Composer 安装:
QR Code Example / 二维码示例
You can generate a QR Code for your secret and display it in HTML using Google Chart API: 可以使用 Google Chart API 为密钥生成二维码,并在 HTML 中显示:
HTML preview / 在网页中显示二维码:
This will render a QR code that can be scanned by Google Authenticator or other TOTP apps.
这将生成一个二维码,可被 Google Authenticator 或其他 TOTP 应用扫描添加。
Configuration / 配置
Set OTP code length / 设置验证码长度:
Notes / 注意事项
Make sure that used codes cannot be reused to prevent replay attacks. 确保验证码不可重复使用,防止重放攻击。
Limit verification attempts to prevent brute-force attacks. 限制验证次数以防止暴力破解。
Compatible with standard 2FA apps (Google Authenticator, Authy, 1Password, etc.) 兼容标准 2FA 应用(Google Authenticator、Authy、1Password 等)