laranex/laravel-biometric-auth

A laravel package to provide asymmetric biometric authentication
10,785 10
Install
composer require laranex/laravel-biometric-auth
Latest Version:v3.0.0
PHP:^7.0|^8.0
Laravel:10 – 13
Older releases:5 – 9
License:MIT
Last Updated:Oct 13, 2026
Links: GitHub  ·  Packagist
Maintainer: NayThuKhant

A laravel package to provide asymmetric biometric authentication

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Create Biometric Verify Biometric

Supported Public Keys

https://phpseclib.com/docs/publickeys

Installation

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',
    ],
];

Usage

// 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");

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

aporat/laravel-auth-signature

A Laravel package providing a middleware for validating API requests with HMAC-S...

1,800 0
laranex/laravel-refresh-token

A package to help you implement refresh token mechanism in your laravel applicat...

1,267 1
hmacauth/laravel-hmac-auth

HMAC API authentication for Laravel with signature verification, replay attack p...

0 0
artisanpack-ui/security-advanced-auth

Enterprise authentication for Laravel — WebAuthn/FIDO2 passwordless auth, SSO (S...

2,704 0
tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

55,134,762 11,486

Version History

Version Released PHP Laravel License
v3.0.0 ^7.0|^8.0 MIT
v2.0.0 ^7.0|^8.0 ^5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.0.0 ^7.0|^8.0 ^5.8|^6.0|^7.0|^8.0|^9.0 MIT
Pre-releases (5)
Version Released PHP Laravel License
v4.0.0-alpha.8 ^8.1 ^10.0||^11.0||^12.0||^13.0 MIT
v4.0.0-alpha.7 ^8.1 ^10.0||^11.0||^12.0||^13.0 MIT
v4.0.0-alpha.6 ^8.1 ^10.0||^11.0||^12.0||^13.0 MIT
v4.0.0-alpha.2 ^8.1 ^10.0||^11.0||^12.0||^13.0 MIT
v4.0.0-alpha.1 ^8.1 ^10.0||^11.0||^12.0||^13.0 MIT