1、安装composer
2、https://github.com/ChristianRiesen/otp
这个包可以生成有效token
3、composer install
4、
5、add keyword
6、
7、add script
8、modify script
<?php
include '/Users/XXXX/otp/vendor/autoload.php';
use Otp\Otp;
use ParagonIE\ConstantTime\Encoding;
$secret = "SAFASFSFAFSASF";
$otp = new Otp();
$token = $otp->totp(Encoding::base32DecodeUpper($secret));
if(strlen($token) == 5){
$token = "0$token";
}
echo "12313141".$token;
9、copy to Clipboard