ttungbmt/laravel-socialite-geonode

Laravel Socialite 地理节点 OAuth2 提供程序

1.0.0 2022-09-14 16:24 UTC

This package is auto-updated.

Last update: 2024-09-06 04:57:20 UTC


README

composer require ttungbmt/laravel-socialite-geonode

安装与基本使用

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

将配置添加到 config/services.php

'geonode' => [    
  'client_id' => env('GEONODE_CLIENT_ID'),  
  'client_secret' => env('GEONODE_CLIENT_SECRET'),  
  'redirect' => env('GEONODE_REDIRECT_URI'),
],

添加提供程序事件监听器

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

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

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \TungTT\LaravelSocialite\GeoNode\GeoNodeExtendSocialite::class.'@handle',
    ],
];

使用方法

现在您应该能够像常规使用 Socialite 一样使用提供程序(假设您已安装了 facade)

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

返回的用户字段

这些字段可能会根据不同的作用域而有所不同

  • id
  • name
  • email