定制 comes/simpleauthenticator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

comes/simpleauthenticator

最新稳定版本:v2.1

Composer 安装命令:

composer require comes/simpleauthenticator

包简介

A PHP library for implementing Google Authenticator's two-factor authentication (2FA) with Laravel, ensuring enhanced security for user authentication.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The SimpleAuthenticator package provides a straightforward implementation of the Google Authenticator algorithm for Laravel applications. It enables easy generation of one-time passwords (OTPs) based on a provided secret key.

Read more about the Google Authenticator algorithm in the RFC 6238 or check wikipedia TOTP

Usage

To use the SimpleAuthenticator, create an instance of the SimpleAuthenticator class by providing the secret key. Then, you can call the generate() method to generate the one-time password.

use Comes\SimpleAuthenticator\SimpleAuthenticator;

$secret = 'YOUR_SECRET_KEY';
$authenticator = new SimpleAuthenticator;
$oneTimePassword = $authenticator->generate($secret);

Laravel Integration

The SimpleAuthenticator package provides a Laravel command to generate OTPs. To use it, you need to publish the package configuration and add the secret keys to the configuration file.

php artisan vendor:publish --provider="Comes\SimpleAuthenticator\SimpleAuthenticatorServiceProvider" --tag="config"

After publishing the configuration, you can add your secret keys to the config/simpleauthenticator.php file. Then, you can use the otp command to generate an OTP for a specific app:

php artisan otp app-name

Testing

Testing

You can run the tests using Pest:

composer test
composer test-coverage

Changelog

Please see the Latest Release for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固