league/oauth2-github
GitHub OAuth 2.0 provider for the League OAuth2 client. Easily add GitHub login and API authorization to PHP applications with a simple, standards-based integration built on league/oauth2-client.
league/oauth2-client means GitHub is one class among many; adding GitLab or Bitbucket later is a provider swap, not a rewrite. That's a real option value when your ICP is "engineering teams" and the second-integration request arrives six months in.read:org, repo) let you gate features on real org membership rather than an email-domain heuristic — a materially better enterprise-sales story ("you can only see your team's data") and a cheaper one than building SAML.Adopt when:
league/oauth2-client and need a GitHub provider for a non-Laravel PHP service.Look elsewhere when:
knplabs/github-api, Octokit equivalents). OAuth2 user tokens are a different permission model.Mitigation if you adopt anyway: wrap it behind your own GitHubAuth interface, vendor or fork if needed, pin the version (^2.0), and log it in the tech-debt register with a named fallback (GenericProvider with GitHub endpoints configured manually is a ~20-line escape hatch). Treat it as a 2-file convenience, not a strategic dependency. Note that the 2.0.0 bump is a removal, not a feature release — the integration code you write against it is the same as 1.x, so the migration cost for existing consumers is a runtime check, not a rewrite.
For executives — one paragraph: This is a small, free, MIT-licensed component that lets the product offer "Sign in with GitHub" without our engineers building the security-sensitive token exchange from scratch. It is not a platform bet — it's roughly two classes of glue code with no lock-in, replaceable in an afternoon. The strategic value is speed: it shortens the path from signup to a working GitHub integration, which is our fastest route into developer teams and the prerequisite for a much larger repo-and-automation roadmap. On the risk side, the maintenance picture improved slightly with the 2.0.0 release — the package now supports PHP 7.1 and the project shipped its first update since 2017 — though one housekeeping release is a sign of life, not a support guarantee. Because the code surface is tiny and sits on a well-maintained foundation, we treat the residual risk as manageable: we isolate it behind our own interface and can swap it out cheaply.
For engineering — the ask: Adopt league/oauth2-github ^2.0 behind an internal auth interface for [service], not scattered through controllers. Confirm your target runtime is PHP 7.1+ — 2.0.0 drops PHP 5.5 and is a breaking change on the runtime floor, so any PHP 5.6/7.0 service must either upgrade or pin to 1.x. The 2.0.0 notes contain no API, scope, or security changes, so integration code is unchanged from 1.x; the migration is a runtime check, not a rewrite. Timebox a half-day spike to confirm PHP 8.x compatibility, PKCE behavior, and Enterprise base-URL override — 2.0.0 added PHP 7.1 support, which does not establish PHP 8.x readiness. If the spike fails, fall back to GenericProvider with manually configured GitHub endpoints — same foundation, no external dependency. Do not add it to the Laravel app, which should use Socialite's built-in driver. Do not use it if we're heading toward GitHub Apps.
Bottom line: Low cost, low ceiling, real but bounded risk — and slightly less bounded than it was, given the first maintenance activity in years. The 2.0.0 release is a PHP-floor bump, not a capability upgrade; it changes the go/no-go only for services still on PHP 5.5–7.0. Worth it for a single well-scoped GitHub login requirement; not worth it as a foundation for a GitHub integration platform.
How can I help you explore Laravel packages today?