rmelenchenko / leader-id
Leader ID (leader-id.ru) OAuth2 提供商,用于 Laravel Socialite
dev-main
2023-06-19 21:37 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- socialiteproviders/manager: ^3.6 || ^4.0
This package is not auto-updated.
Last update: 2024-09-25 01:57:26 UTC
README
composer require socialiteproviders/leader-id
安装与基本用法
请参阅基本安装指南,然后按照以下特定提供商的说明进行操作。
在 config/services.php
中添加配置
'leader-id' => [ 'client_id' => env('LEADERID_CLIENT_ID'), 'client_secret' => env('LEADERID_CLIENT_SECRET'), 'redirect' => env('LEADERID_REDIRECT_URI') ],
添加提供者事件监听器
配置包的监听器以监听 SocialiteWasCalled
事件。
将事件添加到 app/Providers/EventServiceProvider
中的 listen[]
数组中。有关详细说明,请参阅基本安装指南。
protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // ... other providers \SocialiteProviders\LeaderId\LeaderIdExtendSocialite::class.'@handle', ], ];
用法
现在您应该能够像通常使用 Socialite 一样使用此提供者(假设您已安装 facade)
return Socialite::driver('leader-id')->redirect();
返回的用户字段
- id
- firstname
- lastname
- fathername