nsp-team/google-authenticator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nsp-team/google-authenticator

Composer 安装命令:

composer require nsp-team/google-authenticator

包简介

Google Authenticator

README 文档

README

This is a php library ,Google Authenticator One-time Password Algorithm in PHP

  1. 相对于验证码,安全很多;几乎是不会存在破解的方法
  2. 验证码有时候无法识别,不方便操作
  3. 一机一码,不会存在账号盗用的问题
  4. 动态验证,每30秒生产一个验证码,安全更加保障

see: https://www.phpgangsta.de/2-faktor-authentifizierung-mit-dem-google-authenticator

Installation

This library is installable via composer composer require nsp-team/google-authenticator

Usage

require_once "vendor/autoload.php";

use NspTeam\Authenticator\GoogleAuthenticator;

$ga = new GoogleAuthenticator();

$secret = $ga->createSecret();
echo "Secret is: ".$secret."\n\n";

$qrCodeUrl = $ga->getQRCodeGoogleUrl('Blog', $secret);
echo "Google Charts URL for the QR-Code: ".$qrCodeUrl."\n\n";

$oneCode = $ga->getCode($secret);
echo "Checking Code '$oneCode' and Secret '$secret':\n";

$checkResult = $ga->verifyCode($secret, $oneCode, 2);    // 2 = 2*30sec clock tolerance
if ($checkResult) {
    echo 'OK';
} else {
    echo 'FAILED';
}

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固