koenvg83/socialite-smartschool

Laravel Socialite的Smartschool提供者

dev-master 2021-08-16 18:14 UTC

This package is not auto-updated.

Last update: 2024-09-25 08:16:47 UTC


README

composer require koenvg83/socialite-smartschool

安装和基本用法

请参阅基本安装指南,然后按照以下特定提供者的说明进行操作。

将配置添加到config/services.php

'smartschool' => [    
  'client_id' => env('SMARTSCHOOL_CLIENT_ID'),  
  'client_secret' => env('SMARTSCHOOL_CLIENT_SECRET'),  
  'redirect' => env('SMARTSCHOOL_REDIRECT_URI'),
  'platform' => env('SMARTSCHOOL_PLATFORM')
],

添加提供者事件监听器

配置包的监听器以监听SocialiteWasCalled事件。

将事件添加到app/Providers/EventServiceProvider中的listen[]数组中。有关详细说明,请参阅基本安装指南

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        'SocialiteProviders\\Smartschool\\SmartschoolExtendSocialite@handle',
    ],
];

用法

现在您应该能够像通常使用Socialite一样使用提供者(假设您已安装了外观)

return Socialite::driver('smartschool')->scopes(['userinfo fulluserinfo groupinfo'])->redirect();

返回的用户字段

  • id
  • 昵称
  • 姓名
  • 电子邮件