laravel/socialite
Laravel Socialite provides a fluent OAuth authentication interface for Laravel, with built-in drivers for Bitbucket, Facebook, GitHub, GitLab, Google, LinkedIn, Slack, Twitch, and X. Handles the boilerplate for social login and user retrieval.
laravel/socialite).config/services.php.Socialite facade or service container to authenticate users.
This aligns with Laravel’s "convention over configuration" philosophy, reducing onboarding time.auth:socialite), enabling granular route protection (e.g., restricting access to authenticated social users only).FakeProvider) simplify unit/integration testing, critical for CI/CD pipelines and developer ramp-up.AbstractProvider).hash_equals for constant-time state comparison (v5.26.1), addressing timing attacks.Route::get('/auth/callback', [AuthController::class, 'handleProviderCallback'])->middleware('signed')).id, email, avatar) map to your application’s user model? Will you use Laravel’s HasApiTokens for OAuth tokens?Http::fake())?Socialite::driver('github')).config/services.php for provider credentials.auth system (e.g., Auth::login() for social users).league/oauth2-client (v2.x) for OAuth 2.0 and abraham/twitteroauth (legacy) for OAuth 1.0a.// Before (custom)
$user = OAuth::consumer('github')->getUser();
// After (Socialite)
$user = Socialite::driver('github')->user();
provider_id, provider_user_id, avatar).fbapi scope is included for Graph API access.node_id and custom scopes (e.g., repo).email_verified support.AbstractProvider for unsupported platforms.mapUserToObject() to customize user data mapping.stateless() for providers supporting ID tokens (e.g., Google)./auth/github, /auth/github/callback).mapUserToObject).Auth::login($socialUser)).league/oauth2-client may require updates for new OAuth standards (e.g., PKCE).dependabot or laravel-shift for automated dependency updates (as seen in Socialite’s CI).How can I help you explore Laravel packages today?