承接 lahaxearnaud/laravel-u2f 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

lahaxearnaud/laravel-u2f

最新稳定版本:1.6.2

Composer 安装命令:

composer require lahaxearnaud/laravel-u2f

包简介

U2F support for laravel 6

README 文档

README

Scrutinizer Code Quality SensioLabsInsight

This PSR4 package provide u2f protocol integration in laravel 6 framework.

Requirements

  • A top level domain
  • HTTPS
  • PHP >= 7.2 (If you want to use this package with php 5 you need to use the version v1.1.0)

Install

Via Composer

$ composer require lahaxearnaud/laravel-u2f

Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Configs

$ php artisan vendor:publish --provider="Lahaxearnaud\U2f\U2fServiceProvider" --tag=u2f-config

Assets

$ php artisan vendor:publish --provider="Lahaxearnaud\U2f\U2fServiceProvider" --tag=u2f-components

Views

$ php artisan vendor:publish --provider="Lahaxearnaud\U2f\U2fServiceProvider" --tag=u2f-views

Note that default views use Laravel's default Bootstrap 4. If you don't use it, you have to update the views.

Migrations

$ php artisan vendor:publish --provider="Lahaxearnaud\U2f\U2fServiceProvider" --tag=u2f-migrations
$ php artisan migrate

Middleware

In the app/Http/Kernel.php file

 protected $routeMiddleware = [
    'auth' => \App\Http\Middleware\Authenticate::class,
    // ...
    'u2f' => \Lahaxearnaud\U2f\Http\Middleware\U2f::class,
    ];

Usage

A example project is available to help you with the configuration / usage.

Middleware

In the route.php file add the u2f middleware on your routes or groups:

Route::get('admin/profile', ['middleware' => ['auth', 'u2f'], function () {
    //
}]);

In controller:

/**
 * Create a new controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware(['auth', 'u2f']);
}

Configuration

Events

  • Name: u2f.authentication

    Payload: [ 'u2fKey' => $key, 'user' => Auth::user() ]

    Description: An user authenticate himself with a valid u2f key

  • Name: u2f.register

    Payload [ 'u2fKey' => $key, 'user' => Auth::user() ]

    Description: An user register a new u2f key

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email lahaxe[dot]arnaud[at]gmail[dot]com instead of using the issue tracker.

Credits

License

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

After coding

What better way to relax, after spending hours coding, than a good cocktail on the terrace?

统计信息

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

GitHub 信息

  • Stars: 53
  • Watchers: 3
  • Forks: 23
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-16