league/oauth2-linkedin
A LinkedIn OAuth 2.0 provider for the League OAuth2 Client. It handles LinkedIn authorization redirects, access token exchange, and resource owner details, making LinkedIn login integration simple in PHP applications.
league/oauth2-client, or (c) buy a hosted identity vendor (Auth0, Clerk, WorkOS, Supabase Auth) that owns provider churn. This package is the "cheap and self-hosted" corner of that matrix; it's the right call when identity is not a differentiator but a checkbox.league/oauth2-client plus per-provider adapters creates a repeatable pattern (Google, Microsoft, GitHub, Apple) instead of N bespoke integrations. If LinkedIn is the only provider, that abstraction is over-engineering and Laravel Socialite is the shorter path.Consider it when:
league/oauth2-client — this provider snaps in as one config entry and one class, no new dependency tree.Look elsewhere when:
r_liteprofile / r_emailaddress scopes. Treat this package as a starting point, not a supported product — verify its endpoints and scope strings against current LinkedIn developer docs before you plan around it.laravel/socialite is the idiomatic route and already covers social login with Laravel conventions; adding league/oauth2-client underneath Socialite is redundant unless you need the lower-level abstraction for multiple providers.To executives (30 seconds): This is a small, free, MIT-licensed adapter that lets our Laravel app add "Sign in with LinkedIn" in days rather than weeks. It's low-cost and low-commitment — no vendor contract, no per-login fees, no user data routed through a third party. It is not a strategic platform bet: the library hasn't been updated since 2020 and LinkedIn has changed its authentication APIs since then, so we should treat it as a head start we own and maintain, not a supported product. Recommendation: fund a one-day technical spike, and decide based on whether the current LinkedIn endpoints still work as-is.
To engineering: It's a thin provider class for league/oauth2-client — URL construction, token exchange, and a resource-owner mapping. Minimal surface, no exotic dependencies, trivial to fork and vendor if upstream stays quiet. The real work is not the library: it's verifying current LinkedIn scopes and the userinfo endpoint post-OIDC migration, handling the case where LinkedIn returns no email, and deciding account-linking behavior for users who already signed up with a password. Estimate accordingly — library integration ~1 day, the surrounding product work ~2–5 days.
To security/compliance: Flag the dependency age up front. It's MIT, it's small enough to audit in an afternoon, and we can pin or vendor it. The auth code path itself is standard OAuth 2.0 authorization code flow; the risk is drift in LinkedIn's API contract, not malicious code.
To the business sponsor: The measurable ask is signup conversion and profile completeness, not "LinkedIn integration." Instrument both before and after; if LinkedIn login doesn't move activation for a B2B audience, the correct decision is to remove the button — not to keep maintaining a stale dependency.
How can I help you explore Laravel packages today?