jampire/moonshine-passkeys

Biometric Authentication for MoonShine Admin Panel

Maintainers

Package info

github.com/Jampire/moonshine-passkeys

pkg:composer/jampire/moonshine-passkeys

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

v0.1.1 2026-04-04 23:00 UTC

This package is auto-updated.

Last update: 2026-04-05 17:46:03 UTC


README

build downloads license release composer contributors contributors

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\HasPasskeys trait 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):

Profile Page Component

Here is an example of how the package works on MacBook with iCloud Keychain and Conditional UI enabled:

iCloud Demo

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.