elison/laravel_google_2fa
Composer 安装命令:
composer require elison/laravel_google_2fa
包简介
A Package for 2fa google authentication in Laravel Framework
README 文档
README
Package for 2fa Google authentication in Laravel Framework
Installation
composer require elison/laravel_google_2fa
Add the provider in the app.php
config/app.php
\Elison\GoogleAuthenticator\GoogleAuthenticatorProvider::class
Add table that stores the secret keys
php artisan migrate
Methods available
1. GoogleAuthenticator::generateQrCodeUrl($applicationName, $width, $height, $level) -> This method generates the QR Code which user needs to scan with Google Authenticator, and returns the secret key and qr code url
2. GoogleAuthenticator::setCredentials($userId, $secretKey) -> This method stores the secret key for the user that will be used later on, it may be used when the user has finished with code scanning
3. GoogleAuthenticator::checkIfTwoFaIsActive($userId) -> This method checks if the 2fa is active for the user, can be used to not display qr code again for an already authenticated user.
4. GoogleAuthenticator::verifyIfCodeIsValid($userId, $code) -> This method verifies if the code that the authenticated user enters is valid.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-27