Laravel Socialite

An expressive OAuth 1 & 2 client for Laravel that handles social login boilerplate

Library
Composer
vv5.30.0
5,747stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity80
Maintenance76
Community88
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture84
Code Quality82
Innovation70
Learning Curve86

Laravel Socialite gives a Laravel application a fluent, uniform interface for authenticating users through third-party OAuth providers, shipping first-party drivers for Bitbucket, Facebook, GitHub, GitLab, Google, LinkedIn, Slack, Twitch, and X. Instead of hand-rolling the OAuth redirect/callback dance, token exchange, and user-profile fetch for each provider, an application calls Socialite::driver('github')->redirect() and Socialite::driver('github')->user() and gets back a normalized user object with name, email, avatar, and the provider’s access token.

The package wraps both OAuth 1.0a (via league/oauth1-client, used for X/Twitter) and OAuth 2.0 flows (via Guzzle and firebase/php-jwt for OpenID Connect providers) behind the same Provider interface, and integrates with Laravel’s service container and facades as a first-party Laravel package maintained by the Laravel team. As of the current major version the maintainers are not accepting new first-party drivers; additional providers are covered by the community-maintained Socialite Providers project.

What You Get

  • A Socialite::driver('name')->redirect() / ->user() API that abstracts the OAuth 1/2 authorization-code flow for each supported provider
  • First-party drivers for Bitbucket, Facebook, GitHub, GitLab, Google, LinkedIn (including OpenID Connect), Slack (including OpenID Connect), Twitch, and X
  • A normalized User object exposing id, name, email, nickname, avatar, and the raw provider access token/refresh token
  • Stateless mode for API-driven or mobile OAuth flows that skip Laravel’s session-based CSRF state check
  • A Socialite::fake() testing helper for asserting redirect/callback behavior in feature tests without hitting a real provider

Common Use Cases

  • Adding “Sign in with Google/GitHub/Facebook” buttons to a Laravel application’s login page
  • Building a developer-tools SaaS that authenticates users via their GitHub or GitLab account
  • Linking a user’s Slack or Twitch account to enable OAuth-based API calls on their behalf
  • Supporting stateless OAuth logins in mobile app backends where session-based state isn’t available

Under The Hood

Architecture - SocialiteManager (extending Laravel’s Manager class) resolves the configured driver name to a concrete provider class under src/Two/ (e.g. GithubProvider, GoogleProvider) or src/One/TwitterProvider for OAuth 1.0a; each provider extends Two/AbstractProvider (or One/AbstractProvider), which implements the shared redirect-URL construction, state/PKCE handling, and token exchange against Guzzle, while individual providers only override provider-specific endpoints and user-mapping logic. SocialiteServiceProvider registers the manager and facade into Laravel’s container. Tech Stack - PHP 7.2/8.x targeting Laravel 6 through 13 (illuminate/contracts, illuminate/http, illuminate/support), using GuzzleHTTP for HTTP calls, firebase/php-jwt for verifying OpenID Connect ID tokens, league/oauth1-client for the OAuth 1.0a (X/Twitter) flow, and phpseclib/phpseclib for cryptographic operations required by some providers. Code Quality - 14 test files under tests/ (run via PHPUnit and Orchestra Testbench, a Laravel package-testing harness) cover each provider’s redirect URL construction, token exchange, and user mapping using Mockery-mocked HTTP responses; the project also runs PHPStan for static analysis. Commit and release activity is steady (81 tagged releases, ~5.3 commits/month), reflecting active first-party maintenance despite the driver-freeze policy. API Design - The public API is deliberately small and consistent across all nine providers: Socialite::driver($name)->redirect() and ->user() are the only two calls most integrations need, with stateless(), scopes(), and with() as fluent modifiers, and Socialite::fake() mirrors Laravel’s other facade-testing helpers (Http::fake(), Mail::fake()) for familiarity.

Used by 8 apps in this directory

PHP
72%
MIT

Bagisto

Analytics · Ecommerce

27,983

Open-source Laravel eCommerce platform for building multi-vendor marketplaces, B2B stores, headless commerce, and AI-powered storefronts.

View details
93
Repo Health
75
Technical
69
Dependency
Built with
PHP72%
Blade22%
Updated today
PHP
79%
Apache 2.0

Coolify

Devops · Hosting Control Panel

60,738

Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in

View details
92
Repo Health
86
Technical
72
Dependency
Built with
PHP79%
Blade18%
Updated yesterday
PHP
82%
MIT

Databasement

Databases · Devops · Developer Tools

1,974

Self-hosted database backup manager with a web UI for scheduling, encrypting, and restoring MySQL, PostgreSQL, MongoDB, SQL Server, SQLite, Firebird, and Redis to S3, SFTP, Samba, or local storage.

View details
81
Repo Health
77
Technical
69
Dependency
Built with
PHP82%
Blade17%
Updated 4 days ago
PHP
85%
Other

Invoice Ninja

Invoicing Finance · Project Management

10,008

Self-hostable invoicing, time-tracking, and multi-gateway payment platform for freelancers and small businesses, with built-in e-invoicing compliance for EU and global standards.

View details
97
Repo Health
83
Technical
62
Dependency
Built with
PHP85%
XSLT10%
Updated 2 days ago
PHP
48%
AGPL 3.0

Leantime

Productivity · Project Management · Collaboration

11,391

Project management built for ADHD, autism, and dyslexia — simple as Trello, powerful as Jira

View details
90
Repo Health
68
Technical
67
Dependency
Built with
PHP48%
CSS20%
Blade17%
Updated 4 days ago
PHP
65%
AGPL 3.0

LinkStack

Marketing

3,797

Self-hosted, privacy-focused Linktree alternative with themes, analytics, and a drag-and-drop admin panel.

View details
75
Repo Health
56
Technical
68
Dependency
Built with
PHP65%
Blade35%
Updated 4 weeks ago
PHP
61%
Other

OpnForm

Forms Surveys · Marketing

3,609

Build unlimited, embeddable forms with no code — powered by AI, logic rules, and real-time analytics

View details
90
Repo Health
75
Technical
69
Dependency
Built with
PHP61%
Vue31%
Updated yesterday
PHP
63%
AGPL 3.0

Vanguard Backup

Devops

37

Self-hosted backup automation for Ubuntu and Debian servers with S3 storage, SSH-based file and database backup, and multi-channel notifications.

View details
33
Repo Health
80
Technical
70
Dependency
Built with
PHP63%
Blade36%
Updated 9 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search