eightynine / filament-passkeys
Webauthn in you filamentphp application.
Requires
- php: ^8.2|^8.3|^8.4
- filament/filament: ^3.0
- illuminate/contracts: ^11.0|^12.0
- spatie/laravel-package-tools: ^1.15.0
- spatie/laravel-passkeys: ^1.0
Requires (Dev)
- nunomaduro/collision: ^8.1
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
A powerful Filament plugin that adds WebAuthn (passkey) authentication to your Filament application. Enable users to authenticate securely using biometric authentication, security keys, or device-based credentials without passwords.
Getting Started
This plugin integrates seamlessly with Filament panels to provide passwordless authentication using WebAuthn technology. Users can register passkeys and authenticate using fingerprints, face recognition, or hardware security keys.
Installation
Install the package via Composer:
composer require eightynine/filament-passkeys
Publish Migrations
Publish and run the migrations to create the passkeys table:
php artisan vendor:publish --tag="filament-passkeys-migrations"
php artisan migrate
Publish Config
Publish the configuration file to customize the plugin settings:
php artisan vendor:publish --tag="filament-passkeys-config"
Add the Plugin to the Service Provider
Register the plugin in your Filament panel provider (e.g., app/Providers/Filament/AdminPanelProvider.php
):
use EightyNine\Passkeys\PasskeysPlugin; public function panel(Panel $panel): Panel { return $panel ->default() ->id('admin') ->path('admin') // ... other panel configuration ->plugins([ PasskeysPlugin::make() ->useCustomLogin(), // Optional: Use custom login page with passkey support ]); }
User Model Configuration
Ensure your User model implements the HasPasskeys
contract and uses the InteractsWithPasskeys
trait:
<?php namespace App\Models; use EightyNine\Passkeys\Contracts\HasPasskeys; use EightyNine\Passkeys\Concerns\InteractsWithPasskeys; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable implements HasPasskeys { use InteractsWithPasskeys; // ... rest of your User model }
Optionally, you can publish the views for customization:
php artisan vendor:publish --tag="filament-passkeys-views"
Configuration
The published configuration file allows you to customize various aspects of the plugin:
<?php // config for EightyNine/Passkeys return [ /* |-------------------------------------------------------------------------- | Manage Passkeys Page Configuration |-------------------------------------------------------------------------- | | These settings control the appearance and behavior of the Manage Passkeys | page in Filament. | */ 'manage_passkeys' => [ 'enabled' => true, 'label' => 'Manage Passkeys', 'plural_label' => 'Manage Passkeys', 'title' => 'Manage Your Passkeys', 'navigation_icon' => 'heroicon-o-key', 'navigation_label' => 'Passkeys', 'navigation_group' => 'Security', 'navigation_sort' => 10, 'slug' => 'manage-passkeys', 'cluster' => null, 'breadcrumb' => 'Passkeys', 'can_access' => true, 'show_in_navigation' => true, ], /* |-------------------------------------------------------------------------- | Passkey Settings |-------------------------------------------------------------------------- | | General settings for passkey functionality | */ 'settings' => [ 'enable_registration' => true, 'enable_authentication' => true, 'max_passkeys_per_user' => 10, 'passkey_timeout' => 60000, // milliseconds 'require_user_verification' => false, 'authenticator_attachment' => null, // 'platform', 'cross-platform', or null ], /* |-------------------------------------------------------------------------- | View Configuration |-------------------------------------------------------------------------- | | Customize the view and layout settings | */ 'views' => [ 'manage_passkeys' => 'filament-passkeys::pages.manage-passkeys', 'layout' => null, // Custom layout if needed ], /* |-------------------------------------------------------------------------- | Security Settings |-------------------------------------------------------------------------- | | Configure security-related options | */ 'security' => [ 'rate_limit' => [ 'attempts' => 5, 'decay_minutes' => 15, ], 'require_confirmation' => false, 'log_activities' => true, ], ];
Usage
Once configured, users will see a "Sign in with Passkey" option on the login page. They can also manage their passkeys through the dedicated management page in the admin panel.
Features
- Passwordless Authentication: Users can log in using biometrics or security keys
- Passkey Management: Built-in page for users to manage their registered passkeys
- Custom Login Page: Optional custom login page with enhanced passkey support
- Flexible Configuration: Extensive configuration options for different use cases
- Multi-Panel Support: Works with multiple Filament panels
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.