A laravel package to provide asymmetric biometric authentication
laranex/laravel-biometric-auth is a Laravel package for a laravel package to provide asymmetric biometric authentication.
It currently has 10 GitHub stars and 9.240 downloads on Packagist (latest version v3.0.0).
Install it with composer require laranex/laravel-biometric-auth.
Discover more Laravel packages by laranex
or browse all Laravel packages to compare alternatives.
Last updated

https://phpseclib.com/docs/publickeys
You can install the package via composer:
composer require laranex/laravel-biometric-auth
You can publish and run the migrations with:
php artisan vendor:publish --tag="biometric-auth-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="biometric-auth-config"
This is the contents of the published config file:
<?php
return [
'table' => env('BIOMETRIC_AUTH_TABLE', 'biometrics'),
// You will need to be explicit about the encryption padding and hash algorithm when working with RSA keys.
// For the rest of the algorithms, the package will automatically detect with the help of phpseclib.
'rsa' => [
'encryption_padding' => \phpseclib3\Crypt\RSA::SIGNATURE_PKCS1,
'hash_algorithm' => '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("Base 64 encoded public key");
// Create a challenge for biometric authentication
$biometric = Laranex\LaravelBiometricAuth\Facades\LaravelBiometricAuth::getBiometric("UUID of a biometric");
// Verify the signature
Laranex\LaravelBiometricAuth\Facades\LaravelBiometricAuth::verifyBiometric("UUID of a biometric", "Signature");
// Get the user of verified biometric key
$user = Biometric::find("UUID of a biometric")->instance;
// Revoke a biometric
$user->revokeBiometric("UUID of a biometric");
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.