Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Oauth Laravel Package

lusitanian/oauth

A PHP library for OAuth 1 and OAuth 2 authentication, offering ready-made service wrappers for dozens of providers like Google, Facebook, Twitter, and GitHub. It handles token requests, refreshes, and API calls, and integrates with Laravel via a service provider and facade.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor to conditional. lusitanian/oauth is a standalone, framework-agnostic OAuth 1.0a/2.0 client library. It solves the "obtain and refresh a token from a third-party provider" problem, which in a Laravel codebase is already the explicit territory of Laravel Socialite (OAuth 2 only, first-party maintained, ships with the framework). The only genuine capability gap this package fills is OAuth 1.0a request signing, which Socialite does not support. If our requirement set is "Google/GitHub/Microsoft login," this package adds nothing but risk. If our requirement set includes a legacy OAuth 1 provider (older Twitter endpoints, Tumblr, NetSuite, certain B2B/EDI and banking sandboxes), it is one of the few off-the-shelf options — though league/oauth1-client is the maintained alternative and should be evaluated first.

Integration feasibility — moderate effort, low friction technically. The library is Composer-installable, has a per-provider class structure (*\Service classes with a shared AbstractService), and no Laravel coupling at all. That means no service provider, no facade, no config publishing, no queue/event hooks — we write all of that. Realistically: one wrapper service class, one config file for client IDs/secrets/scopes/callback URLs, one binding in a service provider, and an adapter per provider. It returns token objects (StdOAuth2Token, etc.) that we must persist ourselves; the package does not store, encrypt, or refresh tokens on a schedule. Budget ~1–2 sprints of spike plus build for 2–3 providers, including test harness work.

Technical risk — high, and the dominant factor in this evaluation. The last release was 2018-04-26; that is multiple PHP major versions and a full OAuth 2.1 era ago. Concrete exposures:

  • No PKCE. OAuth 2.1 mandates PKCE for public clients, and major providers increasingly require or strongly encourage it. This is a hard blocker for any flow that touches a mobile app, SPA, or native client.
  • No OpenID Connect. No id_token parsing, no JWKS signature validation, no nonce handling. If we want verified identity (not just an access token), we must layer that ourselves — and hand-rolled id_token validation is exactly where auth bugs become incidents.
  • Unmaintained crypto/token handling. An OAuth client is security-sensitive code. With no maintainer, a CVE in this library's signing, state-parameter, or redirect-validation logic will never be patched by upstream. We inherit it permanently.
  • Dependency drift. Its HTTP layer pins older Guzzle ranges; conflicts with the guzzlehttp/guzzle ^7 that current Laravel stacks pull in are likely and will surface as Composer resolution failures at the worst possible time (mid-upgrade).
  • Provider rot. Several providers in its service list have since changed or removed the OAuth endpoints the library targets. The library cannot know this; failures will be runtime, not compile-time.
  • Zero dependents as reported is a weak ecosystem signal — no downstream projects exercising edge cases, no community patches, no de facto fork.
  • Ecosystem support is nil. Stars (1,073) reflect 2013–2016 popularity, not present-day viability. Score 38.8 corroborates.

Key questions to resolve before any code is written:

  1. Do we have a hard OAuth 1.0a requirement, or is every provider we care about OAuth 2/OIDC? (If the latter, this package is disqualified.)
  2. Which specific providers, and have we verified their current endpoints against this library's 2018-era implementations?
  3. Does any consuming client involve an SPA, mobile app, or other public client that requires PKCE?
  4. Do we need verified identity (id_token) or only an access token to call an API on the user's behalf?
  5. What is our PHP/Laravel floor, and does this package's Guzzle constraint resolve cleanly against it?
  6. Are we prepared to fork and internally own this code — including security patching — or does it need to stay a pinned third-party dependency?
  7. What is the cost of league/oauth1-client + Socialite + a thin OIDC layer versus adopting this? (Expect the "two maintained libraries" path to win on total cost of ownership.)

Integration Approach

Stack fit. Laravel-idiomatic integration is entirely our construction: a config/oauth.php (per-provider credentials, scopes, redirect URI, token TTL), an OAuthServiceProvider binding a TokenManager and provider registry into the container, a SocialAccount/OAuthToken Eloquent model with encrypted casts for access and refresh tokens, and a narrow internal interface (OAuthProviderContract::redirect(), ::callback(), ::refresh(), ::revoke()). Everything the package exposes stays behind that interface — no Lusitanian\ types leak into controllers, jobs, or domain code. This is the single most important design decision: it converts a stale dependency into a swappable implementation detail.

Migration path (recommended): Do not adopt as a greenfield choice. Treat it as a bridge only where an OAuth 1 requirement genuinely exists, and prefer this sequencing:

  1. Audit — inventory every provider and flow in the product; classify OAuth 1 vs 2 vs OIDC; flag public clients.
  2. Baseline — where flows are OAuth 2/OIDC, standardize on Laravel Socialite (plus a maintained OIDC validator if identity verification is required).
  3. Isolate — for the OAuth 1 residual, evaluate league/oauth1-client first; if this package is chosen for expedience, wrap it immediately behind OAuthProviderContract so nothing else depends on it.
  4. Contain — pin the exact version in composer.json, commit composer.lock, and add a CI check that fails on unexpected transitive changes.
  5. Replace — schedule removal against a dated milestone, not "later." A stale auth dependency with no sunset date is a permanent liability.

Compatibility. Requires a PHP 5.3+ runtime (fine) but predates modern PSR-18 HTTP abstractions and PHP 8 typing; expect deprecation noise under PHP 8.x and possible signature/null-handling warnings. Verify Guzzle constraint resolution against the host app first — if it conflicts, the migration ends here and there is no workaround short of a fork.

Sequencing. Contract + config + adapter + tests land as one PR (no partial wiring). Provider cutover happens per-provider, behind a feature flag, with the old path retained until a full token lifecycle (authorize → store → refresh → revoke) is verified against the live provider in staging. Do not bundle this with a Laravel/PHP upgrade — decouple the two so a Composer conflict can't stall the platform upgrade.

Operational Impact

Maintenance — this is the crux. Ownership transfers to us on day one. No upstream accepts patches; no release will fix a broken provider or a signing flaw. Budget an ongoing internal line item: quarterly review of provider endpoint changes, dependency audit, and a named owner for security response. Realistically this is a fork-and-vendor commitment, not a dependency — and that should be reflected in the estimate, because forking means we now maintain an OAuth library, which is not a small thing to own.

Support. No vendor, no SLA, no active issue triage. Developer-facing support is GitHub archaeology on 2014–2018 threads. Team ramp-up is deceptively easy (the API is simple; the README is adequate) but the debugging ramp is steep: failures arrive as generic Guzzle exceptions or provider HTML error pages, with no structured error taxonomy, so on-call triage of "login is broken" starts from a stack trace. Invest early in structured logging around the callback and refresh paths (provider, correlation ID, HTTP status, provider error code) — that instrumentation is what makes this operable.

Scaling. The library itself is stateless and per-request, so it is not a horizontal-scaling bottleneck. The real scaling concerns are ours: (a) refresh concurrency — parallel jobs refreshing the same token will race; use a cache lock keyed on the token record; (b) rate limiting — per-provider throttles and backoff belong in our wrapper, not the library; (c) token volume — encrypted token storage and rotation grow with user count, so plan for key rotation and re-encryption; (d) provider quotas — third-party limits, not our infrastructure, will be the ceiling during traffic spikes, and unhandled 429s here look like auth failures to users.

Failure modes. Ranked by likelihood: provider endpoint changed or was retired (silent, user-visible login breakage); token refresh fails and the user is logged out with no recovery path; Composer resolution breaks during an unrelated upgrade; expired/revoked token surfaces as an opaque 401 deep in a background job; state/redirect validation gaps turn into a security finding (no PKCE compounds this); provider outage produces cascading errors rather than a graceful degraded state. Mitigations: circuit-breaker on provider calls, explicit "re-authenticate" UX path, contract tests against each provider in staging, and alerting on callback failure rate rather than on raw exceptions.

Ramp-up. Assume ~1 week for a mid-level Laravel developer to be productive behind the wrapper, plus ~1 week for the initial spike and provider verification. Add materially more if we fork. The larger cost is organizational: this dependency requires a standing owner, and absent that, it will quietly decay into an incident.

Recommendation. Score of 38.8 and a 2018 last release make this a negative-value default choice. Adopt only as a time-boxed bridge for a specific, verified OAuth 1.0a requirement that league/oauth1-client cannot cover, isolated behind an internal interface, pinned, and scheduled for replacement. Standard OAuth 2/OIDC flows in a Laravel codebase should go to Socialite plus a maintained OIDC validator.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource