- Can I use spomky-labs/oauth2-server-exception-manager-bundle in a Laravel application?
- No, not as a Composer dependency. It is a Symfony2 bundle designed to be registered in AppKernel and wired through Symfony's DI container, so a Laravel app cannot bootstrap it — there is no service provider, facade, or config publishing. Composer may resolve the package, but nothing will load it. Treat it as source material to port rather than something to require.
- What does this bundle actually do?
- It integrates the Spomky-Labs OAuth2 server exception manager, converting OAuth2 authorization and token errors into consistent HTTP responses and RFC 6749-style error payloads. Functionally it is a thin adapter layer over spomky-labs/oauth2-server-library-era code, so most of the value is a small amount of exception-to-response mapping. Much of the package is likely Symfony DI and configuration glue.
- Is it compatible with Laravel Passport or league/oauth2-server?
- No. Passport builds on league/oauth2-server, which ships its own exception types and response handling, while this bundle targets a different, older Spomky-Labs library generation. There is no shared exception hierarchy or integration point. If you use Passport or League, you already have the mapping behavior you need.
- Which Symfony and PHP versions does this bundle target?
- It targets Symfony2, whose 2.8 branch reached end of life in November 2018. The codebase almost certainly uses PHP 5.x/7.0-era idioms and will not run on PHP 8.x without patching for removed functions, deprecated dynamic properties, and stricter types. Check composer.json for the exact pinned Symfony components and OAuth2 library versions before considering it.
- Is this package safe to use in production?
- High risk. It has zero stars, zero dependents, no issue triage, and no production validation, which is unacceptable for a security-adjacent component where incorrect error responses can leak grant state or produce non-compliant payloads. Symfony2 is end of life, so any transitive CVEs are inherited from abandoned branches with no upstream patching. You would own all future security fixes.
- How do I install it?
- In a Symfony2 project you would add it via Composer and register the bundle in AppKernel, then configure it through YAML or XML bundle configuration. In Laravel there is no equivalent registration step, so installation alone accomplishes nothing. If you only need the mapping logic, copy the relevant classes instead.
- What is the Laravel alternative for OAuth2 error responses?
- Use league/oauth2-server directly or Laravel Passport, which wraps it. Both ship compliant exception types and produce RFC 6749 section 5.2 error and error_description payloads out of the box, so you rarely need custom mapping. If you have a bespoke client contract, add a small exception renderer in your Laravel app rather than pulling in a legacy bundle.
- Can I extract the exception mapping logic into a Laravel package?
- Yes, but treat it as a fork, not an integration. Lift the exception-manager classes into a plain PHP, PSR-7/PSR-15-oriented package, review them line by line, then wrap them in a Laravel service provider and exception handler binding. Given the likely size — a few hundred lines — rewriting from the RFC is often cheaper than porting untested code.
- Does it produce RFC 6749 compliant error responses?
- That is its intent: map OAuth2 server exceptions to correct HTTP status codes with error, error_description, and where applicable error_uri fields per RFC 6749 section 5.2. However, compliance is unverified by any test suite or community usage in the evaluation, so you would need to validate every response shape yourself. Most teams find League's built-in exceptions already cover this.
- Is there a maintained successor from the same author?
- Yes, the same author moved on to oauth2-server-bundle and League-based integrations, which cover the same mapping semantics on supported Symfony versions. That path is where the maintenance and security patches live. There is no reason to start a new project on this Symfony2-era bundle.