jampire/moonshine-passkeys 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jampire/moonshine-passkeys

最新稳定版本:v0.1.2

Composer 安装命令:

composer require jampire/moonshine-passkeys

包简介

Biometric Authentication for MoonShine Admin Panel

README 文档

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.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固