项目作者: arnissolle

项目描述 :
PHP implementation of Multi-Factor Authentication (MFA)
高级语言: PHP
项目地址: git://github.com/arnissolle/php-mfa.git
创建时间: 2019-10-26T13:25:37Z
项目社区:https://github.com/arnissolle/php-mfa

开源协议:MIT License

下载


Latest Version on Packagist
Build Status
Quality Score
Total Downloads

Installation

You can install the package via composer:

  1. composer require arnissolle/php-mfa

Supported third party Authenticator app

Google Microsoft LastPass Authy

Usage

  1. use Arnissolle\MFA\OTP\Auth;
  2. use Arnissolle\MFA\OTP\Code;
  3. use Arnissolle\MFA\OTP\Secret;
  4. // Create new secret
  5. $secret = Secret::create();
  6. // Get the OTP auth URI
  7. $authUri = Auth::uri($secret, 'jdoe@domain.tld', function(Auth $auth) {
  8. $auth->issuer = 'Company Name';
  9. });
  10. // Get the QR Code
  11. // Then scan it with app like Google Authenticator
  12. $qrCodeUrl = Auth::qrCodeUrl($authUri);
  13. // Get code (or use third party app)
  14. $code = Code::get($secret);
  15. // Verify code (bool)
  16. $verify = Code::verify($secret, $code);

Testing

  1. composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email pierre@arnissolle.com instead of using the issue tracker.

Credits

License

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

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.