spomky-labs/oauth2-server-exception-manager
Converts League OAuth2 Server exceptions into proper HTTP responses for PHP applications. Provides customizable error rendering so your API returns consistent, standards-compliant OAuth2 error output instead of raw exceptions. Lightweight, PSR-friendly, and easy to integrate into any framework.
invalid_request, invalid_client, invalid_grant, invalid_scope, unsupported_grant_type, unauthorized_client) into correct HTTP responses — status codes, WWW-Authenticate headers, Cache-Control: no-store. The PM decision it informs is "do we hand-roll error mapping in our token endpoint, or adopt a library that already encodes RFC 6749 semantics?"Adopt only when all of the following hold:
spomky-labs/oauth2-server (or the corresponding Symfony bundle) at a version that declares this as a dependency, and you want its exception handling rather than custom middleware.Look elsewhere when:
league/oauth2-server with league/oauth2-server-bundle, or Laravel Passport, which already ships league's exception types and response handling. This package would be redundant.To executives: This is a small, free plumbing library that makes our OAuth2 token endpoint return standards-compliant error responses — the kind auditors and integration partners check. It ships no user-facing feature and costs nothing to license. The tradeoff is community traction: essentially nobody else uses it, so if it breaks, we fix it. Recommendation: treat it as a "reimplement in a day" item, not a strategic dependency.
To engineering: It is exception-to-HTTP-response glue for the Spomky OAuth2 server ecosystem. If we are not already on that stack, skip it — league/oauth2-server (and therefore Passport) already solves this. If we are, evaluate whether its current release supports our PHP version, then decide between adopting it and writing the mapping ourselves; the latter is low-effort and removes an unmaintained dependency from our tree.
How can I help you explore Laravel packages today?