mirkco / laravel-passport-facebook-login
Facebook Token Request Grant for Laravel Passport
Installs: 498
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 25
Open Issues: 2
pkg:composer/mirkco/laravel-passport-facebook-login
Requires
- facebook/graph-sdk: ^5.4
- laravel/passport: ^2.0
This package is not auto-updated.
Last update: 2025-12-07 02:41:39 UTC
README
Please see @danjdewhurst's repo https://github.com/danjdewhurst/Laravel-Passport-Facebook-Login for a more up-to-date version.
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
Note: A new User will be created if an existing user was not found for the given token
Install
Install with composer... composer require mirkco/laravel-passport-facebook-login
Versions
- Laravel 5.4 and Passport 2.0 only supported at this time
Setup
- Add
Mirk\PassportFacebookLogin\FacebookLoginGrantProvider::classto your list of providers afterLaravel\Passport\PassportServiceProvider. - Add
Mirk\PassportFacebookLogin\FacebookLoginTraitTrait to yourUsermodel (or whatever model you have configured to work with Passport). - Add your Facebook App details to your
.envfile
# file .env
FACEBOOK_APP_ID={app_id from Facebook}
FACEBOOK_APP_SECRET={app_secret from facebook}
How to use
- Make a POST request to
https://your-site.com/oauth/token, just like you would a Password or Refresh grant. - The POST body should contain
grant_type=facebook_loginandfb_token={token from facebook login}. - An
access_tokenandrefresh_tokenwill be returned if successful.
Notes:
It is assumed that your User model has first_name and last_name fields.
Thanks
This package is based off https://github.com/mikemclin/passport-custom-request-grant