jirkavrba/cvut-socialite-provider
Composer 安装命令:
composer create-project jirkavrba/cvut-socialite-provider
包简介
A socialite provider for the authentication server of the FIT CTU in Prague
README 文档
README
This is a custom Laravel Socialite provider for the authentication server of the FIT CTU in Prague.
The authentication server can be found here.
Installation
To install this package simply add jirkavrba/cvut-socialite-provider to your composer.json file.
This can be also done via the composer command
composer require jirkavrba/cvut-socialite-provider
Then, add your credentials to the .env
CVUT_CLIENT_ID="" CVUT_CLIENT_SECRET="" CVUT_CALLBACK_URL=""
and config/services.php
return [ // Other services 'cvut' => [ 'client_id' => env('CVUT_CLIENT_ID'), 'client_secret' => env('CVUT_CLIENT_SECRET'), 'redirect' => env('CVUT_CALLBACK_URL'), ], ];
You also need to extend the socialite service within a service provider, this
can be done eg. in the AppServiceProvider by creating a private method
private function bootCvutSocialiteProvider() { $socialite = $this->app->make('Laravel\Socialite\Contracts\Factory'); $socialite->extend( 'cvut', function ($app) use ($socialite) { $config = $app['config']['services.cvut']; return $socialite->buildProvider(CvutProvider::class, $config); } ); }
and then call this method from within the boot() method.
This should be all you need to do, then you can simply use the provider within your controllers like:
public function redirectToProvider(): RedirectResponse { return Socialite::with('cvut')->redirect(); }
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-15