PHPackages                             lahaxearnaud/laravel-u2f - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. lahaxearnaud/laravel-u2f

AbandonedArchivedLibrary[Security](/categories/security)

lahaxearnaud/laravel-u2f
========================

U2F support for laravel 6

1.6.2(6y ago)5257.2k↑763.3%21[4 issues](https://github.com/lahaxearnaud/laravel-u2f/issues)MITJavaScriptPHP &gt;=7.2

Since May 20Pushed 4y ago3 watchersCompare

[ Source](https://github.com/lahaxearnaud/laravel-u2f)[ Packagist](https://packagist.org/packages/lahaxearnaud/laravel-u2f)[ Docs](https://github.com/lahaxearnaud/laravel-u2f)[ RSS](/packages/lahaxearnaud-laravel-u2f/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (13)Versions (23)Used By (0)

laravel-u2f
===========

[](#laravel-u2f)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d2ec26361eb0f88e43a6893d22a1f9eacc4117b2ac8415b489148a7064013a88/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c616861786561726e6175642f6c61726176656c2d7532662f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lahaxearnaud/laravel-u2f/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/d219e790c94a1cddce0e9d49e53a5602181187b6924b03370ddd87d6963e8768/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f63383566613366312d373835342d346565632d393332642d3861633632356331333138632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/c85fa3f1-7854-4eec-932d-8ac625c1318c)

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

Requirements
------------

[](#requirements)

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

Install
-------

[](#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

[](#configs)

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

### Assets

[](#assets)

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

### Views

[](#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

[](#migrations)

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

### Middleware

[](#middleware)

In the app/Http/Kernel.php file

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

Usage
-----

[](#usage)

A [example project](https://github.com/lahaxearnaud/laravel-u2f-example) is available to help you with the configuration / usage.

### Middleware

[](#middleware-1)

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

[](#configuration)

### Events

[](#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
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Arnaud LAHAXE](https://github.com/lahaxearnaud)
- [Mike Robinson](https://github.com/multiwebinc)
- [Chakphanu Komasathit](https://github.com/chakphanu)
- [Anne Jan Brouwer](https://github.com/annejan)
- [Alexis Saettler](https://github.com/asbiin)
- [Thomas Lété](https://github.com/bistory)
- [Luca Bognolo](https://github.com/bogny)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

After coding
------------

[](#after-coding)

What better way to relax, after spending hours coding, than a good [cocktail](https://cocktailand.fr) on the terrace?

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 69.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~35 days

Total

21

Last Release

2302d ago

Major Versions

v0.5 → v1.0.02017-10-04

PHP version history (3 changes)v0.1.0PHP &gt;=5.3.0

v1.2.0PHP &gt;=7.0

1.6.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/bab37acc38e46b09f3452e2b81711dced89874ffa35a188687905242c4248011?d=identicon)[alahaxe](/maintainers/alahaxe)

---

Top Contributors

[![lahaxearnaud](https://avatars.githubusercontent.com/u/1364221?v=4)](https://github.com/lahaxearnaud "lahaxearnaud (48 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![bistory](https://avatars.githubusercontent.com/u/108102?v=4)](https://github.com/bistory "bistory (3 commits)")[![multiwebinc](https://avatars.githubusercontent.com/u/901732?v=4)](https://github.com/multiwebinc "multiwebinc (2 commits)")[![asbiin](https://avatars.githubusercontent.com/u/25419741?v=4)](https://github.com/asbiin "asbiin (2 commits)")[![vrajroham](https://avatars.githubusercontent.com/u/12662173?v=4)](https://github.com/vrajroham "vrajroham (1 commits)")[![chakphanu](https://avatars.githubusercontent.com/u/2822342?v=4)](https://github.com/chakphanu "chakphanu (1 commits)")[![IDevJoe](https://avatars.githubusercontent.com/u/11019048?v=4)](https://github.com/IDevJoe "IDevJoe (1 commits)")[![annejan](https://avatars.githubusercontent.com/u/294470?v=4)](https://github.com/annejan "annejan (1 commits)")

---

Tags

laravellaravel-5-packagelaravel-6-packagelaravel-u2fphpsecurityu2f-keyotpsecurityu2f

### Embed Badge

![Health badge](/badges/lahaxearnaud-laravel-u2f/health.svg)

```
[![Health](https://phpackages.com/badges/lahaxearnaud-laravel-u2f/health.svg)](https://phpackages.com/packages/lahaxearnaud-laravel-u2f)
```

###  Alternatives

[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k25.9M651](/packages/laravel-lumen-framework)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9552.1M82](/packages/roots-acorn)[themosis/framework

The Themosis framework.

670306.3k17](/packages/themosis-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
