Adds additional grant types to Laravel's Passport library
bigpaulie/laravel-social-passport is a Laravel package for adds additional grant types to laravel's passport library.
It currently has 0 GitHub stars and 12 downloads on Packagist.
Install it with composer require bigpaulie/laravel-social-passport.
Discover more Laravel packages by bigpaulie
or browse all Laravel packages to compare alternatives.
Last updated
This project is ideal for applications where the front-end is decoupled from the back-end such as vue.js, angular, cordova, etc. Providing stateless social authentication via Laravel's Passport library.
Install social passport via composer
composer require bigpaulie/laravel-social-passport
Publish package resources.
php artisan vendor:publish
Run the migrations
php artisan migrate
By using the package I assume that you've already installed and configured laravel/passport package.
At this moment I assume that your user table has a first_name and a last_name column, the migration file will automatically add a facebook_id column.
Add the FacebookPassportProvider to you config/app.php providers array
\Bigpaulie\Laravel\Social\Passport\FacebookPassportProvider::class,
Add the SocialPassport contract to your user model.
use SocialPassport;
From this moment onward you are ready to use Facebook's access token to authenticate your users.
Send a POST request to oauth/token with the following body
{
"grant_type": "facebook_login",
"client_id": "<passport_client_id>",
"client_secret": "<passport_client_secret>",
"facebook_token": "<facebook_access_token>"
}
Pay attention to the "grant_type" key
In order for this project to function properly some extra packages are needed.
The following features will be added in the future.
Contributions are most welcomed as long as you follow the existing code style and testing pattern.
Please feel free to fork, code and submit a pull request