通用用例的认证适配器。

dev-develop 2022-09-12 15:31 UTC

This package is auto-updated.

Last update: 2024-09-17 16:11:13 UTC


README

()

帮助或添加认证功能的相关内容。

双因素认证

生成和验证令牌和PIN码。

生成令牌

$token = new \Inane\Authentication\TwoFactor\Token('Inane');
echo "$token";

验证OTP

$otp = new \Inane\Authentication\TwoFactor\OneTimePin($token);
$valid = $otp->verifyOTP('612777');

QR码URL

$imgUrl = $token->getQRCodeUrl();
// OR
$imgBase64 = $token->getImageBase64();