PHPackages                             mpociot/laravel-face-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. mpociot/laravel-face-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

mpociot/laravel-face-auth
=========================

Use Microsoft Face API as a authentication method in your Laravel app.

0.1.0(9y ago)16451030[3 issues](https://github.com/mpociot/laravel-face-auth/issues)[1 PRs](https://github.com/mpociot/laravel-face-auth/pulls)MITPHPPHP ^7.0

Since Mar 13Pushed 3y ago8 watchersCompare

[ Source](https://github.com/mpociot/laravel-face-auth)[ Packagist](https://packagist.org/packages/mpociot/laravel-face-auth)[ Docs](https://github.com/mpociot/laravel-face-auth)[ RSS](/packages/mpociot-laravel-face-auth/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Face authentication
===========================

[](#laravel-face-authentication)

This package uses Microsoft's cognitive API to identify faces instead of passwords for your Laravel application.

Disclaimer
==========

[](#disclaimer)

> Any kind of Face Recognition, using the camera of the device as a form of Authentication is flawed. You only need to hold a good photo in front of the camera to by pass it. Using this for authentication is like shooting in your own foot and contributing for a more insecure web.

Please **do not** use face recognition as an alternative for password authentication in a production system!

Installation
------------

[](#installation)

You can install the package via Composer:

```
$ composer require mpociot/laravel-face-auth
```

Add the service provider to your `config/app.php`:

```
Mpociot\FaceAuth\FaceAuthServiceProvider::class,
```

In your `config/auth.php`, change the auth driver to `faceauth`:

```
'providers' => [
    'users' => [
        'driver' => 'faceauth',
        'model' => App\User::class,
    ],
]
```

Publish the configuration:

```
$ php artisan vendor:publish --provider="Mpociot\FaceAuth\FaceAuthServiceProvider"
```

Edit the newly published `config/faceauth.php` file and enter your [Face API key](https://www.microsoft.com/cognitive-services/en-us/face-api).

Usage and authorization
-----------------------

[](#usage-and-authorization)

The face authentication works, by using a reference image of your user and matching it against a uploaded image upon login. So this pretty much is the same flow as comparing two password hashes.

When you register your users, you need to make sure that you store a photo of the users face - this is basically his password.

In order for this package, to find the user photo, your `User` model needs to implement the `FaceAuthenticatable` interface.

This interface only has one single public method `getFaceAuthPhoto()`. This method needs to return the content of the user photo.

Example:

```
class User extends Authenticatable implements FaceAuthenticatable
{

    public function getFaceAuthPhoto()
    {
        return File::get(storage_path('facces') . $this->id . '.png');
    }

}
```

Your login form now needs a `photo` field (the name can be configured) - this field should contain a base64 representation of the image, the user uses to log in.

> If you want a simple way to capture the user image from the webcam, take a look at the [vue-webcam](https://github.com/smronju/vue-webcam) Vue.js component.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3392d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b46cb765edab3c6a765bd466bb2a530e0e95cbd74cf7dfc250c59a2b029b73ca?d=identicon)[mpociot](/maintainers/mpociot)

---

Top Contributors

[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (7 commits)")[![lex111](https://avatars.githubusercontent.com/u/4408379?v=4)](https://github.com/lex111 "lex111 (1 commits)")

---

Tags

laravelmicrosoft-cognitive-servicesmpociotlaravel-face-auth

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpociot-laravel-face-auth/health.svg)

```
[![Health](https://phpackages.com/badges/mpociot-laravel-face-auth/health.svg)](https://phpackages.com/packages/mpociot-laravel-face-auth)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[overtrue/socialite

A collection of OAuth 2 packages.

1.4k5.6M90](/packages/overtrue-socialite)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

121242.9k1](/packages/ellaisys-aws-cognito)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
