PHPackages                             lipetuga/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. lipetuga/laravel-u2f

ActiveLibrary[Security](/categories/security)

lipetuga/laravel-u2f
====================

U2F support for laravel 7

1.8.5(5y ago)054MITJavaScriptPHP &gt;=7.2

Since May 20Pushed 5y agoCompare

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

READMEChangelogDependencies (12)Versions (29)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="Lipetuga\U2f\U2fServiceProvider" --tag=u2f-config
```

### Assets

[](#assets)

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

### Views

[](#views)

```
$ php artisan vendor:publish --provider="Lipetuga\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="Lipetuga\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' => \Lipetuga\U2f\Http\Middleware\U2f::class,
    ];
```

Usage
-----

[](#usage)

A [example projet](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

Change log
----------

[](#change-log)

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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 58.1% 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 ~76 days

Recently: every ~85 days

Total

27

Last Release

2015d 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://avatars.githubusercontent.com/u/16760060?v=4)[LipeTuga](/maintainers/LipeTuga)[@LipeTuga](https://github.com/LipeTuga)

---

Top Contributors

[![lahaxearnaud](https://avatars.githubusercontent.com/u/1364221?v=4)](https://github.com/lahaxearnaud "lahaxearnaud (43 commits)")[![LipeTuga](https://avatars.githubusercontent.com/u/16760060?v=4)](https://github.com/LipeTuga "LipeTuga (15 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (6 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)")[![IDevJoe](https://avatars.githubusercontent.com/u/11019048?v=4)](https://github.com/IDevJoe "IDevJoe (1 commits)")[![chakphanu](https://avatars.githubusercontent.com/u/2822342?v=4)](https://github.com/chakphanu "chakphanu (1 commits)")[![annejan](https://avatars.githubusercontent.com/u/294470?v=4)](https://github.com/annejan "annejan (1 commits)")

---

Tags

otpsecurityu2f

### Embed Badge

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

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M531](/packages/laravel-passport)

PHPackages © 2026

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