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.
spomky-labs contracts rather than on league/oauth2-server contracts (the de-facto PHP standard, and what Laravel Passport and the Symfony OAuth2 bundles are built on). This is a roadmap-level decision about who owns your auth abstractions.Consider it only if all of the following hold:
oauth2-server, oauth2-client, related HTTP factories) and need the shared contracts those packages type against — i.e., a maintenance/upgrade task on an existing codebase, not a greenfield choice.Look elsewhere — decisively — in essentially every other case:
league/oauth2-server) covers authorization code + PKCE, password, client credentials, personal access tokens, scopes, and ships migrations, guards, and middleware. It is the low-risk, high-support baseline.league/oauth2-server directly, or a managed IdP (Auth0, Okta, Keycloak, Cognito, WorkOS) if OIDC, SSO, MFA, SCIM, or audit/compliance obligations are on the roadmap.Risk signals a PM should factor in: no stars, no dependents, and a package whose only content is interfaces implies negligible community validation and no support surface. Treat it as unmaintained until proven otherwise; assume no security-response SLA and no upgrade path. Dependency-health review should flag it as avoid for new work.
For executives (one line): This is a set of PHP interface definitions for an OAuth2 server — a blueprint with no engine. It does not give us login, tokens, or security out of the box, and almost nobody in the ecosystem uses it. Recommendation: do not adopt; use Laravel Passport or a managed identity provider, which we can support, audit, and staff for.
For engineering leads: The package supplies contracts (Client, AccessToken, RefreshToken, AuthorizationCode, Scope) from the Spomky-Labs ecosystem. It is interface-only, has no dependents, and no observable community traction — so adopting it means writing and owning 100% of the implementation while taking on a non-standard dependency. The pragmatic path is league/oauth2-server via Passport (Laravel) or direct league/oauth2-server contracts, which are widely used, maintained, and already aligned with the Symfony/Laravel tooling our team knows. Revisit this package only if we inherit a Spomky-Labs codebase and need to keep it compiling.
Framing the trade-off for the room: OAuth2 is security-critical infrastructure; the cost is not in the interfaces but in the maintenance, patching, and conformance burden. We should spend our engineering budget on product differentiation, not on re-implementing a token server against an interface library with no community behind it. Buying (Passport) or outsourcing (managed IdP) reduces risk and time-to-market; building against this package maximizes both.
How can I help you explore Laravel packages today?