r0073rr0r/laravel-webauthn

Laravel Livewire WebAuthn package for registration and login.

Installs: 15

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/r0073rr0r/laravel-webauthn

1.1.1 2025-10-31 13:05 UTC

This package is auto-updated.

Last update: 2025-10-31 13:12:07 UTC


README

Packagist Version Total Downloads Monthly Downloads PHP Version License GitHub Stars GitHub Issues GitHub Forks

Laravel package with Livewire components for WebAuthn authentication (biometric authentication, USB security keys, 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

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

⚙️ 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):

<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):

<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.