feilongluo / apple
Laravel Socialite 的 Apple OAuth2 提供者。支持 php 7.1 和 laravel 5.6,修订版。
v4.0.1
2020-11-03 09:38 UTC
Requires
- php: ^7.1
- ext-json: *
- ext-openssl: *
- firebase/php-jwt: ^5.2
- lcobucci/jwt: ^3.1
- socialiteproviders/manager: ~2.0 || ~3.0
Suggests
- feilongluo/socialite-apple-helper: Automatic Apple client key generation and management.
This package is auto-updated.
Last update: 2024-09-06 11:51:55 UTC
README
composer require feilongluo/apple:v4.0.1
安装与基本使用
请参阅基本安装指南,然后按照以下提供者特定的说明进行操作。
添加配置到 config/services.php
'apple' => [ 'client_id' => env('APPLE_CLIENT_ID'), 'client_secret' => env('APPLE_CLIENT_SECRET'), 'redirect' => env('APPLE_REDIRECT_URI') ],
添加提供者事件监听器
配置包的监听器以监听 SocialiteWasCalled
事件。
将事件添加到 app/Providers/EventServiceProvider
中的 listen[]
数组。有关详细说明,请参阅基本安装指南。
protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // ... other providers 'SocialiteProviders\\Apple\\AppleExtendSocialite@handle', ], ];
使用方法
现在您应该能够像常规使用 Socialite 一样使用提供者(假设您已安装了外观)
return Socialite::driver('apple')->redirect();
返回的用户字段
id
name
email