Apple
Apple stats
- Downloads
- 2.7M
- Stars
- 39
- Open Issues
- 2
- Forks
- 42
Apple OAuth2 Provider for Laravel Socialite
Laravel SocialiteProviders/Apple Package
The socialiteproviders/apple package enables Laravel applications to authenticate users via Apple ID using Laravel Socialite. This integration simplifies the process of adding "Sign In with Apple" functionality to your application.
Key Features:
- Simple Integration: Leverage Laravel Socialite for streamlined OAuth handling.
- Configurable: Easily configure client IDs, secrets, and redirect URIs through Laravel's
config/services.php. - Dynamic Client Secret Management: Supports generating JWT token-based client secrets with a maximum lifetime of 6 months, crucial for maintaining "Sign In with Apple" sessions.
- Event Listening: Utilize Laravel's event system to hook into Socialite's OAuth flow.
- User Data: Retrieve basic user information such as
id,name, andemail.
Installation:
-
Require the Package:
composer require socialiteproviders/apple -
Configuration: Add the following to your
config/services.php:'apple' => ['client_id' => env('APPLE_CLIENT_ID'),'client_secret' => env('APPLE_CLIENT_SECRET'),'redirect' => env('APPLE_REDIRECT_URI')],Refer to external guides for setting up Apple ID authentication and generating the client secret:
-
Add Event Listener: Register the event listener in
app/Providers/EventServiceProvider:protected $listen = [\SocialiteProviders\Manager\SocialiteWasCalled::class => [\SocialiteProviders\Apple\AppleExtendSocialite::class.'@handle',],];
Basic Usage:
To initiate the authentication process, use:
return Socialite::driver('apple')->redirect();
Additional References:
This package provides a robust solution for integrating Apple's authentication system into Laravel projects, ensuring a smooth user experience with essential security features.