minawilliam / apple-socialite-provider
此包已被废弃且不再维护。未建议替代包。
Laravel Socialite 的 Apple OAuth2 提供器
5.0.1
2021-01-07 02:09 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- ext-openssl: *
- firebase/php-jwt: ^5.2
- lcobucci/jwt: ^4.0
- socialiteproviders/manager: ~4.0
Suggests
- ahilmurugesan/socialite-apple-helper: Automatic Apple client key generation and management.
This package is not auto-updated.
Last update: 2022-08-19 00:59:15 UTC
README
composer require socialiteproviders/apple
安装 & 基本使用
请参阅基本安装指南,然后按照以下特定提供器说明操作。
将配置添加到 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 一样使用此提供器(假设您已安装了 facade)
return Socialite::driver('apple')->redirect();
返回的用户字段
id
name
email