spomky-labs/oauth2-interface
PHP interfaces and contracts for building OAuth2 authorization and resource servers. This package defines the core abstractions used across the Spomky-Labs OAuth2 framework, letting you implement standards-compliant flows with your own storage, clients, and token handlers.
Architecture fit. spomky-labs/oauth2-interface is a contracts-only library: it ships PHP interfaces (and a few supporting traits) describing OAuth2 domain objects — clients, access tokens, refresh tokens, authorization codes, scopes. It contains no concrete implementation, no ServiceProvider, no facade, no config, no migrations, and no middleware. In a Laravel application it does nothing on its own. Its only possible role is as a type-hint vocabulary for a custom-built OAuth2 authorization server — which is a build-vs-buy decision that has already been settled decisively by the ecosystem in favor of league/oauth2-server and laravel/passport.
Integration feasibility. Composer-installable, but that is the entire out-of-the-box experience. To get any value, a team must supply implementations for every interface: entity classes, repositories, token persistence, grant validation, revocation, and PSR-7 request/response plumbing. There is no documented Laravel binding path. The integration effort is unbounded and open-ended, which is the worst possible shape for a dependency in a product roadmap.
Technical risk.
league/oauth2-server. Adopting an archived contract layer means inheriting a contract you cannot evolve.league/oauth2-server; bridging it to Laravel middleware would be hand-rolled.Key questions.
composer.json, composer.lock, or source (grep for the namespace)?Assessment: do not adopt. The correct target state is laravel/passport (full OAuth2 server) or laravel/sanctum (first-party token issuance), both of which are actively maintained and Laravel-native.
Stack fit. Poor. Laravel's supported answers are Passport (wraps league/oauth2-server, provides migrations, guards, scopes, and a full authorization server) and Sanctum (SPA/mobile first-party tokens). This package sits underneath neither and would require a bespoke bridge.
Migration path.
composer.json, run composer update, verify no autoload references, deploy through the normal pipeline. Low risk, one-PR change.league/oauth2-server entity interfaces, or drop them entirely.league/oauth2-server equivalent, port token tables, and preserve existing token values through the cutover so live sessions are not force-invalidated.Compatibility. Assume Composer-level incompatibility with PHP 8.1+/Laravel 10+. Validate this first — it may collapse the decision to "remove" immediately. There is no PSR-7/PSR-15 alignment, so middleware integration is manual regardless.
Sequencing.
Maintenance. None available. No releases, no maintainer SLA, no backlog. Keeping it means forking it, which converts a public dependency into permanent in-house code ownership — the single most expensive outcome for a TPM to sign off on.
Support. The community channel is effectively dead. Issue searches, Stack Overflow answers, and blog guidance will be stale and will point at an implementation that no longer exists.
Scaling. Not applicable at the interface layer. All scaling concerns — token storage growth, revocation lists, refresh-token rotation, key rotation, per-client rate limits — land entirely on whatever implementation the team hand-rolls. That is where the real operational risk concentrates.
Failure modes.
Ramp-up. Low to read the interfaces; high to actually ship. Engineers would learn RFC 6749/6750/7636 semantics from scratch instead of inheriting a hardened, widely deployed implementation, and would own that knowledge permanently.
Recommendation. Reject as a dependency. Standardize on Passport for third-party OAuth2 and Sanctum for first-party tokens, and treat any existing reference to this package as technical debt with a dated removal ticket.
How can I help you explore Laravel packages today?