r0073rr0r/laravel-webauthn

Laravel Jetstream and Livewire package for WebAuthn authentication (biometrics, USB security keys, and passkeys)

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/r0073rr0r/laravel-webauthn

1.2.0 2025-11-06 12:36 UTC

This package is auto-updated.

Last update: 2025-11-06 12:51:48 UTC


README

Packagist Version Total Downloads Monthly Downloads PHP Version License GitHub Stars GitHub Issues GitHub Forks Tests CodeQL PHP Composer

A Laravel package that integrates seamlessly with Jetstream and Livewire to provide WebAuthn authentication — including support for biometric login, USB security keys, and passkeys.

📋 Requirements

  • PHP 8.2+
  • Laravel 12.x
  • Livewire 3.x
  • Jestream 5.x
  • OpenSSL extension for PHP
  • Composer packages:
    • spomky-labs/base64url ^2.0
    • spomky-labs/cbor-php ^3.1
    • web-auth/webauthn-framework ^5.2

📦 Installation

Install the package via Composer:

composer require r0073rr0r/laravel-webauthn

If you encounter dependency errors, run:

composer require r0073rr0r/laravel-webauthn -W 

Note: The package spomky-labs/cbor-php depends on brick/math ^0.13.

Publish views and config files:

php artisan vendor:publish --provider="r0073rr0r\WebAuthn\WebAuthnServiceProvider"

Publish all package resources (views, translations, and public assets) with a single command:

php artisan vendor:publish --tag=webauthn

Migrate database tables:

php artisan migrate
asciicast installation of package

⚙️ Setup

After publishing the assets, include the WebAuthn JavaScript file in your layout (e.g., in resources/views/layouts/app.blade.php & resources/views/layouts/guest.blade.php or wherever you have your main layout):

<script src="{{ asset('vendor/webauthn/webauthn/webauthn.js') }}"></script>

This script is required for the WebAuthn components to work properly.

🚀 Usage

Registration (WebAuthnRegister)

Add the component to your Blade view (I added it in resources/views/profile/show.blade.php):

Register
 <livewire:web-authn-register />

This component allows users to register their WebAuthn device (fingerprint, Face ID, USB security key, etc.).

Login (WebAuthnLogin)

Add the component to your Blade view (I added it in resources/views/auth/login.blade.php after login form):

Login
 <livewire:web-authn-login />

This component allows users to log in using their previously registered WebAuthn device.

🎨 Customization

You can customize the view files after publishing them:

  • resources/views/vendor/laravel-webauthn/livewire/web-authn-register.blade.php
  • resources/views/vendor/laravel-webauthn/livewire/web-authn-login.blade.php

🔒 Security

WebAuthn is a modern standard for secure passwordless authentication. This package uses browser native WebAuthn APIs for maximum security.

📝 License

MIT License

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.