adoy/oauth2
A framework-agnostic PHP OAuth 2.0 server library that implements authorization and resource servers, common grant types, scopes, and token handling, giving PHP applications a lightweight foundation for secure OAuth2 authentication.
adoy/oauth2 is a ~thin wrapper — a few hundred lines around token exchange and authorization redirects. Reviewing it is a cheap way to scope what "build it ourselves" actually costs. If the estimate is small, you may not need a dependency at all; if it's large, that argues for a maintained library, not this one.league/oauth2-client or Laravel Socialite — a benchmark for scope, not a candidate for adoption.Consider only if:
Look elsewhere if:
league/oauth2-client plus a provider package for general OAuth 2.0 client work; use Laravel Passport or Sanctum if you are issuing tokens rather than consuming them.Adoption gate: maintained within the last 12 months, spec conformance documented, license cleared, tests covering token exchange and error paths, and a named owner. This package fails at least three of those.
To executives: We evaluated adoy/oauth2, a lightweight PHP OAuth 2.0 client. Recommendation: do not adopt for new work. It is built against a 2011 draft of the OAuth specification rather than the ratified standard, shows no active maintenance, and carries an LGPL-2.1 license that adds legal overhead. The cost of adopting it is not the integration — it is the eventual migration plus the security review we would have to run to justify it. Standardizing on Laravel Socialite and league/oauth2-client gives us the same capability with active maintenance and a permissive license, at effectively the same integration cost.
To engineering: It is a thin wrapper — useful as a scope reference, not as a dependency. It predates RFC 6749, so expect gaps around PKCE, redirect URI validation, and token rotation, and assume no upstream security patches. It also has zero dependents on the registry, which means no ecosystem pressure to fix anything. If you find it in an existing codebase, wrap it behind an internal auth interface and schedule replacement; do not extend it. If you are considering building in-house, this is a fair estimate of the floor — and the floor is low enough that the real question is maintenance, not effort.
To legal: LGPL-2.1 requires review before it goes into anything we distribute. Given there is a permissively licensed, better-maintained substitute, that review is avoidable cost.
Bottom line: low opportunity, low urgency. Log it as a rejected option with rationale, and spend the decision energy on which maintained client library becomes the house standard.
How can I help you explore Laravel packages today?