dev-master
9999999-devSocial Authentication
The Requires
Social Authentication
A simple package to add authentication via Socialite, (*1)
Route: login.sns
- Validate provider
- Send user to provider (expects callback), (*2)
Route: login.sns.callback
- Validate provider
- Create / Update User
- Login if valid, (*3)
composer require tyler36/social-auth
php artisan vendor:publish --provider=Tyler36\SocialAuth\SocialAuthServiceProvider
php artisan migrate
./routes/web.php
require __DIR__.'/socialauth.php';
Adding providers.
Create API key information for each provider you would like to you. Each provider requires a client_id
, client_secret
, & client_callback_url
.
A selection of some providers API website can be found in resources/lang/vendor/en/message.php
file., (*4)
Update the services config file
For security, it is recommended to add this to your ENV`` file, then add/update the section in you
config/services.php``` file.
EG.:, (*5)
'github' => [ 'client_id' => env('GITHUB_CLIENT_ID'), 'client_secret' => env('GITHUB_CLIENT_SECRET'), 'redirect' => env('GITHUB_CALLBACK_URL'), ],
config/socialauth
file before this package recognizes the provider as valid.
EG.:'github' => true
There are some (basic) tests., (*6)
phpunit .\vendor\tyler36\social-auth\tests
Social Authentication