jampire / moonshine-passkeys
Biometric Authentication for MoonShine Admin Panel
Requires
- php: ^8.2
- illuminate/collections: ^10|^11|^12
- moonshine/moonshine: ^4.0
- web-auth/webauthn-lib: ^5.2
Requires (Dev)
- driftingly/rector-laravel: ^2.1
- larastan/larastan: ^3.0
- laravel/pint: ^1.27
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.9
- pestphp/pest: ^4.3
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-type-coverage: ^4.0
- rector/rector: ^2.3
Conflicts
This package is auto-updated.
Last update: 2026-04-05 17:46:03 UTC
README
Biometrics (Passkeys) for MoonShine Admin Panel
Introduction
This package provides Biometric authentication and authorization for MoonShine admin panel. It's based on Passkeys technology using WebAuthn protocol. Biometrics allows to login to the admin panel using such technologies as Apple FaceID, Apple TouchID, Android Fingerprint, Windows Hello, Password Managers with Passkey support, etc.
Pre-requirements
Your admin panel should use HTTPS scheme only. Even the localhost.
Installation
Use composer to install MoonShine Passkeys package:
composer require jampire/moonshine-passkeys --with-all-dependencies php artisan migrate
Publish a config file:
php artisan vendor:publish --provider="Jampire\MoonshinePasskeys\PasskeyServiceProvider" --tag=config
This package is designed to work in MoonShine only. You first need to install it. Please read the documentation on how to install and configure MoonShine.
Compatibility
| MoonShine | MoonShine Passkeys | Currently supported |
|---|---|---|
| >= v4.0 | >= v0.1 | yes |
Configuration
Auto-installer is coming soon...
The most critical config option is passkeys.rp_id. It should match the base URL your Admin Panel is running on.
Passkeys are working with MoonShine User model. It should implement
Jampire\MoonshinePasskeys\Models\Contracts\PasskeyContract interface.
- If you are already using the custom MoonShine User model, you need just to add PasskeyContract interface
and
Jampire\MoonshinePasskeys\Models\Concerns\HasPasskeystrait to your model. - If you are using default MoonShine User model, you need to create new model that extends MoonShine User model, and implement PasskeyContract interface:
<?php declare(strict_types=1); namespace App\Models; use Jampire\MoonshinePasskeys\Models\Concerns\HasPasskeys; use Jampire\MoonshinePasskeys\Models\Contracts\PasskeyContract; use MoonShine\Laravel\Models\MoonshineUser; final class Admin extends MoonshineUser implements PasskeyContract { use HasPasskeys; public function getTable(): string { return (new parent())->getTable(); } }
Then you need to tell MoonShine to use your new model:
// config/moonshine.php return [ // ... // Authentication and profile 'auth' => [ // ... 'model' => \App\Models\Admin::class, // ... ], // ... ];
Next step is to tell MoonShine to use LoginForm provided by this package:
// config/moonshine.php return [ // ... // Authentication and profile 'forms' => [ // ... 'login' => \Jampire\MoonshinePasskeys\Components\LoginForm::class, // ... ], // ... ];
It replaces the standard MoonShine Login form. For now, it doesn't support Authentication pipelines.
Please review config/passkeys.php. All important options are described there.
Usage
Passkey component is installed in the user's profile page (admin/page/profile-page by default):
Here is an example of how the package works on MacBook with iCloud Keychain and Conditional UI enabled:
By default, to be able to login with traditional password, you need to type your email and click Login button.
The password field will appear. Type the password and click Login button again.
More detailed documentation is coming soon...
Contributing
Thank you for considering contributing to MoonShine Passkeys project! You can read the contribution guide here.
Code of Conduct
Please review and abide by the Code of Conduct.
Credits
License
MoonShine Passkeys is open-sourced software licensed under the MIT license.

