我办公室/社交名流

MijnKantoorApp OAuth2 Provider for Laravel Socialite

v2.0 2021-04-19 15:21 UTC

This package is auto-updated.

Last update: 2024-09-19 22:49:53 UTC


README

composer require mijnkantoor/socialite

安装与基本用法

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

config/services.php 中添加配置

'mijnkantoorapp' => [    
  'client_id' => env('MIJNKANTOORAPP_CLIENT_ID'),  
  'client_secret' => env('MIJNKANTOORAPP_CLIENT_SECRET'),  
  'redirect' => env('MIJNKANTOORAPP_REDIRECT_URI') 
],

添加提供者事件监听器

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

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

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

用法

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

return Socialite::driver('mijnkantoorapp')->redirect();

返回的用户字段

  • tbd