项目作者: ankurk91

项目描述 :
Laravel passport with socialite
高级语言: PHP
项目地址: git://github.com/ankurk91/laravel-passport-socialite-example.git


Laravel Passport and Socialite example

What?

This is an example repo to demonstrate; how to
use laravel-passport-social-grant package
with socialite to authenticate your mobile app.

Prerequisites

  • php v7.4.3, see Laravel specific requirements
  • Apache v2.4.33 with mod_rewrite
  • MySQL v8.0.19 || 5.7
  • Composer v2.x

Setup

  • Make sure your web server has proper write permissions on ./storage and ./bootstrap/cache folders
  • Create a config file (copy from .env.example), and update environment variables
    1. cp .env.example .env
  • Install dependencies
    ```
    composer install

php artisan key:generate

  1. * Migrate and Seed database

php artisan migrate
php artisan db:seed

  1. * Create the symbolic link for local file uploads

php artisan storage:link

  1. * Run this command for to make Laravel Passport work

php artisan passport:keys
```

  • Point your web server to public folder of this project
  • Create an OAuth app on GitHub, link
  • Put generated client_id and client_secret in .env file
  • Import the postman collection from ./postman folder to see example login request

Hints

  • You can find passport’s client_id and client_secret in seeding
  • You can find the SocialUserResolverInterface implementation here

License

Same as Laravel, MIT license