PHPackages                             gicminos/laravel-passport-facebook-login - 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. gicminos/laravel-passport-facebook-login

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

gicminos/laravel-passport-facebook-login
========================================

Facebook Token Request Grant for Laravel Passport

3.0.1(5y ago)0345MITPHPCI failing

Since Mar 20Pushed 5y agoCompare

[ Source](https://github.com/Gicminos/Laravel-Passport-Facebook-Login)[ Packagist](https://packagist.org/packages/gicminos/laravel-passport-facebook-login)[ RSS](/packages/gicminos-laravel-passport-facebook-login/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (38)Used By (0)

Laravel Passport Facebook Login
===============================

[](#laravel-passport-facebook-login)

Provides a new Laravel Passport Grant Client named `facebook_login`, allowing you to log a user in with just their Facebook Login token.

A new user will be created (and optionally assigned to an role - `$user->attachRole(ID)`) if the email address doesn't exist.

Installation:
-------------

[](#installation)

Install with composer `composer require gicminos/laravel-passport-facebook-login`. Use major version 1 for Passport 4 and below Laravel 5.6 compatibility.

### Versions:

[](#versions)

- Laravel 5.7, with Passport 5, 6 or 7.

Dependencies:
-------------

[](#dependencies)

- [laravel/passport](https://github.com/laravel/passport): `5.0||6.0||7.0`
- [facebook/php-graph-sdk](https://github.com/facebook/php-graph-sdk): `5.6`

Setup:
------

[](#setup)

- Add `Gicminos\PassportFacebookLogin\FacebookLoginGrantProvider::class` to your list of providers **after** `Laravel\Passport\PassportServiceProvider`.
- Add `Gicminos\PassportFacebookLogin\FacebookLoginTrait` Trait to your `User` model (or whatever model you have configured to work with Passport).
- Run `php artisan vendor:publish`, this will create a `config/facebook.php` file.
- Enter your Facebook App details in your `.env` file: `FACEBOOK_APP_ID` and `FACEBOOK_APP_SECRET`.
- Optional: To automatically attach a role () to new users, use the 'ATTACH\_ROLE' env setting.

**Config:**

```
    /*
    |--------------------------------------------------------------------------
    | Application
    |--------------------------------------------------------------------------
    |
    | The facebook ID and secret from the developer's page
    |
    */

    'app' => [
        'id' => env('FACEBOOK_APP_ID'),
        'secret' => env('FACEBOOK_APP_SECRET'),
    ],

    /*
    |--------------------------------------------------------------------------
    | Registration Fields
    |--------------------------------------------------------------------------
    |
    | The name of the fields on the user model that need to be updated,
    | if null, they shall not be updated. (valid for name, first_name, last_name)
    |
    */

    'registration' => [
        'facebook_id' => env('FACEBOOK_ID_COLUMN', 'facebook_id'),
        'email'       => env('EMAIL_COLUMN', 'email'),
        'password'    => env('PASSWORD_COLUMN', 'password'),
        'first_name'  => env('FIRST_NAME_COLUMN', 'first_name'),
        'last_name'   => env('LAST_NAME_COLUMN', 'last_name'),
        'name'        => env('NAME_COLUMN', 'name'),
        'attach_role' => env('ATTACH_ROLE', null),
        'verified'    => env('VERIFIED_COLUMN', null),
    ],
```

How To Use:
-----------

[](#how-to-use)

- Make a **POST** request to `https://your-site.com/oauth/token`.
- The POST body should contain
    1. `grant_type` = `facebook_login`
    2. `fb_token` = `{token from facebook login}`.
    3. client\_id
    4. client\_secret
- An `access_token` and `refresh_token` will be returned if successful.

Assumptions:
------------

[](#assumptions)

- Your `User` model has the folowing fields:
- - `facebook_id`
- - `name` or `first_name` &amp; `last_name`
- - `email`
- - `password`

Why not use Laravel 5.5's auto-discovery?
-----------------------------------------

[](#why-not-use-laravel-55s-auto-discovery)

We have found that using auto discovery can cause issues as this package relies on Laravel Passport been loaded before this package. Sometimes this doesn't happen, and caused issues as Laravel Passport sets up a singleton we reference.

We hope that one day there will be a fix to Laravel auto-discovery that will allow for dependencies to be handled better.

Credits:
--------

[](#credits)

-
-
-

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 65.7% 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

Every ~44 days

Recently: every ~10 days

Total

34

Last Release

1896d ago

Major Versions

1.5.1 → 2.0.02018-02-14

2.3.1 → 3.0.02021-01-21

### Community

Maintainers

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

---

Top Contributors

[![danjdewhurst](https://avatars.githubusercontent.com/u/25198612?v=4)](https://github.com/danjdewhurst "danjdewhurst (46 commits)")[![Gicminos](https://avatars.githubusercontent.com/u/9993624?v=4)](https://github.com/Gicminos "Gicminos (18 commits)")[![Jono20201](https://avatars.githubusercontent.com/u/2374192?v=4)](https://github.com/Jono20201 "Jono20201 (6 commits)")

---

Tags

laravellumenoauthpassportgrant

### Embed Badge

![Health badge](/badges/gicminos-laravel-passport-facebook-login/health.svg)

```
[![Health](https://phpackages.com/badges/gicminos-laravel-passport-facebook-login/health.svg)](https://phpackages.com/packages/gicminos-laravel-passport-facebook-login)
```

###  Alternatives

[coderello/laravel-passport-social-grant

Social Grant for Laravel Passport

179607.4k3](/packages/coderello-laravel-passport-social-grant)[danjdewhurst/laravel-passport-facebook-login

Facebook Token Request Grant for Laravel Passport

2824.4k](/packages/danjdewhurst-laravel-passport-facebook-login)[mikemclin/passport-custom-request-grant

Custom Request Grant for Laravel Passport

343.6k](/packages/mikemclin-passport-custom-request-grant)[adaojunior/passport-social-grant

Social grant for Laravel Passport

116279.2k1](/packages/adaojunior-passport-social-grant)[wearedevtical/novassport

A Laravel Nova tool to manage API Authentication (Passport).

663.1k](/packages/wearedevtical-novassport)

PHPackages © 2026

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