eher/oauth
OAuth 2.0 authentication for Laravel applications, adding token-based authorization, configurable grant flows, access and refresh token handling, and middleware to protect routes and authenticate API requests. Integrates with Eloquent models and the service container.
Architecture fit. eher/oauth is a standalone OAuth 1.0a signing/consumer library, not a Laravel package. It has no service provider, no facade, no publishable config, and no Eloquent-aware token storage. Architecturally it sits below the framework: it handles signature base-string construction, nonce/timestamp generation, and request signing. That means it can fit inside a Laravel app only as a leaf dependency wrapped in our own adapter — it will not participate in the container, event system, or config pipeline on its own. For most greenfield work the fit is poor; for the narrow case of connecting to a legacy OAuth 1.0a provider (or standing up an OAuth 1 provider endpoint), it is a plausible but unpolished building block.
Integration feasibility. Technically feasible in a bounded timebox. The library's surface is small enough that a wrapper service (OAuth1Client) bound as a singleton, plus a config file for consumer key/secret and a DB-backed token model, would cover most of the work. The unknowns are the library's transport behavior — if it ships its own cURL client, we lose Laravel HTTP client observability (retries, logging, middleware) and will likely re-implement the call path on Guzzle/Laravel HTTP anyway, using the library only for signing. That is the recommended shape regardless.
Technical risk. High, concentrated in four places:
$str{0} string offsets, each(), mcrypt_*, implicit dynamic properties). Compatibility must be proven under the target runtime (8.2/8.3), not assumed.league/oauth2-client and Socialite are the correct answers.Key questions.
ext-curl / ext-openssl availability guaranteed in all target environments?Stack fit. Treat the library as an implementation detail behind a first-party interface. Concretely: an OAuth1ServiceProvider registering a singleton client, a config/oauth1.php for credentials, a SocialAccount-style Eloquent model with encrypted casts for token/secret, and a thin OAuth1Gateway interface so the underlying library can be swapped or forked without touching call sites. Route all outbound requests through Laravel's HTTP client; use the package only for signature generation. Never let the package's own HTTP layer leak into domain code.
Migration path. Two scenarios:
OAuthProvider contract only at the level of "get authorization URL / exchange code / refresh" if that abstraction genuinely holds.If the package fails the license audit, the fallback is a small in-house signer: HMAC-SHA1 signature base string construction is roughly 150 lines and is well-documented. That is often cheaper than inheriting unknown code, and it removes the maintenance liability entirely. Size that option early and keep it as the default.
Compatibility. Verify before committing:
ext-openssl present and ext-mcrypt not required.Sequencing.
Do not proceed past step 1 without a clean answer.
Maintenance. Effectively zero upstream maintenance; the burden transfers to us on day one. Budget for a named owner, a vendored fork, and periodic review of the signer against PHP releases. The good news: the OAuth 1.0a spec is frozen, so the protocol will not churn. The bad news: the runtime will, and this code will not keep up on its own.
Support. Community-only, no SLA, small user base means thin Stack Overflow coverage. Internal support relies entirely on the team that wrote the adapter. Any incident escalates to us, not to a vendor.
Scaling. Signing is cheap — HMAC-SHA1 is negligible CPU next to the network round trip. RSA-SHA1 is materially more expensive; if that method is required, measure before assuming, and cache where the provider permits. The real scaling constraint is the outgoing HTTP path: keep it on Laravel's HTTP client so connection pooling, timeouts, retries, and circuit breaking are configurable. Token storage will need indexing on provider + user, and refresh/reissue flows need to be idempotent.
Failure modes. Expect these repeatedly:
oauth_verifier is easy to drop; ensure it is persisted between redirect legs.Ramp-up. OAuth 1.0a is unfamiliar to most engineers now; the mental model (signatures over a canonicalized parameter set) is straightforward but the debugging is punishing. Plan for a half-day of onboarding plus a written internal note on base-string construction and the debug-logging path. The Laravel-side adapter work is routine for anyone fluent in service providers and Eloquent. Net: low-to-moderate ramp-up, but concentrated in one or two people — a bus-factor risk worth naming.
Bottom line. Adopt only if a specific counterparty forces OAuth 1.0a and the license audit clears. In every other case, either move to OAuth 2.0 or write the ~150-line signer in-house and keep ownership. The package is a small, aging utility with an unresolved legal question — the integration cost is modest, the ownership cost is not.
How can I help you explore Laravel packages today?