使用PHP实现双因素身份验证 (2FA)

原文英文,约200词,阅读约需1分钟。发表于:

使用PHP实现双因素身份验证 (2FA) 我们使用google2fa-qrcode组件(https://github.com/antonioribeiro/google2fa-qrcode)来实现: 安装google2fa-qrcode: composer require pragmarx/google2fa-qrcode 安装bacon-qr-code,用于实现二维码显示: composer require bacon/bacon-qr-code 使用方法: 一.在网站后台配置文件中: <?php use PragmaRX\Google2FAQRCode\Google2FA; $google2fa = new Google2FA(); $companyName ='www.xxx.com';//一般用网站域名 $companyEmail= $username;//一般用用户名 也可用email $rt = M()->db->query("select * from twofa_config where userid=$adminid");//从数据库中读secretKey if ($rt) { $row = … The post 使用PHP实现双因素身份验证 (2FA) first appeared on Lenix Blog.

本文介绍了使用PHP实现双因素身份验证的方法。通过安装google2fa-qrcode和bacon-qr-code组件,可以生成二维码并在网站后台配置文件中使用。用户可以通过手机下载Google Authenticator并扫描二维码来增加帐号。在登录时,用户需要输入双因素验证码进行验证。

php
相关推荐 去reddit讨论