andrewnovikof/kinohodsocialiteserviceprovider
| Install | |
|---|---|
composer require andrewnovikof/kinohodsocialiteserviceprovider |
|
| Latest Version: | 1.1.2 |
| PHP: | ^5.6 || ^7.1 |
| License: | MIT |
| Last Updated: | Nov 2, 2017 |
| Links: | GitHub · Packagist |
Kinohod SSO OAuth2 Provider for Laravel Socialite
1. Installation
composer require andrewnovikof/kinohodsocialiteserviceprovider
2. Service Provider
- Remove
Laravel\Socialite\SocialiteServiceProviderfrom yourproviders[]array inconfig\app.phpif you have added it already. - Add
SocialiteProviders\Manager\ServiceProviderto yourproviders[]array inconfig\app.php.
For example:
'providers' => [
// a whole bunch of providers
// remove 'Laravel\Socialite\SocialiteServiceProvider',
SocialiteProviders\Manager\ServiceProvider::class, // add
];
- Note: If you would like to use the Socialite Facade, you need to install it.
3. Add the Event and Listeners
-
Add
SocialiteProviders\Manager\SocialiteWasCalled::classevent to yourlisten[]array in<app_name>/Providers/EventServiceProvider. -
Add your listeners (i.e. the ones from the providers) to the
SocialiteProviders\Manager\SocialiteWasCalled[]that you just created. -
The listener that you add for this provider is
AndrewNovikof\SocialiteProviders\Kinohod\KinohodExtendSocialite::class. -
Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
For example:
/**
* The event handler mappings for the application.
*
* @var array
*/
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
\AndrewNovikof\SocialiteProviders\Kinohod\KinohodExtendSocialite::class
],
];
4. Services Array and .env
Add to config/services.php:
'kinohod' => [
'client_id' => env('KINOHOD_ID'),
'client_secret' => env('KINOHOD_SECRET'),
'redirect' => env('KINOHOD_REDIRECT'),
],
Append provider values to your .env file:
Note: Add both public and secret keys!
// other values above
KINOHOD_ID=your_app_id_for_the_service
KINOHOD_SECRET=your_app_public_for_the_service
KINOHOD_REDIRECT=https://example.com/login
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.