laranex / laravel-biometric-auth
一个用于提供非对称生物识别认证的laravel包
v2.0.0
2024-07-22 05:31 UTC
Requires
- php: ^7.0|^8.0
- illuminate/contracts: ^5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-08-30 07:52:59 UTC
README
需要openssl 3.0^版本才能与iOS密钥协同工作
重要:1.x版本适用于^5.8.x至9.x版本的laravel,请升级到2.x版本以使用laravel 10.x。
安装
您可以通过composer安装此包
composer require laranex/laravel-biometric-auth
您可以使用以下命令发布和运行迁移
php artisan vendor:publish --tag="biometric-auth-migrations"
php artisan migrate
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="biometric-auth-config"
这是已发布配置文件的内容
return [ 'table' => env('BIOMETRIC_AUTH_TABLE', 'biometrics'), 'signature_algorithm' => env('BIOMETRIC_AUTH_ALGORITHM', OPENSSL_ALGO_SHA256), ];
使用方法
// Use Laranex\LaravelBiometricAuth\Traits\HasBiometrics in your Authenticable Model such as User, Admin class User extends Authenticatable { use Laranex\LaravelBiometricAuth\Traits\HasBiometrics; } // Register a new biometric $user->createBiometric("Public Key in base 64 format, not PEM format"); // Create a challenge for biometric authentication $biometric = Laranex\LaravelBiometricAuth\Facades\LaravelBiometricAuth::getBiometric("UUID of a biometric"); // Get the authenticable instance $biometric->instance // Verify the signature Laranex\LaravelBiometricAuth\Facades\LaravelBiometricAuth::verifyBiometric("UUID of a biometric", "Signature"); // Revoke a biometric $user->revokeBiometric("UUID of a biometric");
变更日志
请参阅变更日志以获取有关最近更改的更多信息。
贡献
请参阅贡献指南以获取详细信息。
安全漏洞
请查看我们的安全策略了解如何报告安全漏洞。
鸣谢
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。