Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Oauth Server Bundle

Oauth Server Bundle Laravel Package

amashukov/oauth-server-bundle

View on GitHub
Deep Wiki
Context7

A server side OAuth2 Bundle for Symfony2

Frequently asked questions about Oauth Server Bundle
Can I use FOSOAuthServerBundle directly in a Laravel project?
No, this bundle is designed for Symfony 2.x and relies on Symfony’s Dependency Injection, SecurityBundle, and Doctrine ORM. Laravel’s service container, Eloquent, and authentication system (e.g., Sanctum/Passport) are incompatible without a custom adapter layer, which would require significant refactoring.
What Laravel alternatives provide OAuth2 server functionality?
For Laravel, use **Laravel Passport** (built on League OAuth2 Server) for full OAuth2 support, including modern grants like PKCE and JWT. Sanctum is another option for simpler token-based auth. Both integrate natively with Laravel’s ecosystem and avoid Symfony dependencies.
Does FOSOAuthServerBundle support modern OAuth2 features like PKCE or JWT Bearer tokens?
No, this bundle only implements core OAuth2 grants (authorization code, implicit, client credentials, password) and lacks support for PKCE or JWT Bearer tokens. If your project requires these features, Laravel Passport or a custom implementation using **league/oauth2-server** is a better choice.
How would I integrate this bundle into a Laravel app if I absolutely must?
You’d need to build a bridge layer to mock Symfony’s `ContainerInterface`, translate Symfony’s event system to Laravel’s Events facade, and rewrite security components (e.g., UserProvider) for Laravel’s Auth system. This is a high-effort task (4–8 weeks for MVP) and not recommended unless you’re constrained by legacy Symfony dependencies.
Is FOSOAuthServerBundle compatible with Laravel’s Eloquent ORM?
No, the bundle relies on Doctrine ORM for database operations. To use it with Laravel, you’d need to create custom migrations and entity mappings between Doctrine and Eloquent, adding complexity and potential performance overhead.
What Laravel versions does FOSOAuthServerBundle support?
This bundle is **not designed for Laravel** and has no official support. It targets Symfony 2.x, with limited compatibility for Symfony 3/4/5 via its `^5.0` composer constraint. Laravel’s ecosystem (PHP 8.x, Symfony 6.x) is fundamentally different, making integration impractical.
Are there security risks using this bundle in a Laravel project?
Yes. The bundle is abandoned (last release: 2020) and depends on outdated OAuth2 libraries (e.g., `friendsofsymfony/oauth2-php`). Older OAuth2 implementations may lack protections against modern threats like CVE-2020-25174. Laravel Passport or Sanctum are actively maintained and audited for security.
Can I use this bundle in a hybrid Laravel-Symfony architecture?
Yes, if your Laravel app calls a **Symfony microservice** running this bundle for OAuth2. For example, Laravel could delegate auth requests to a Symfony backend, but this adds latency and complexity. Avoid mixing frameworks unless absolutely necessary.
How do I test FOSOAuthServerBundle in a Laravel context?
Testing is unreliable due to the bundle’s abandoned state and lack of Laravel integration. The README notes ‘TODO: More tests,’ and critical flows (e.g., token revocation) may be untested. For Laravel, use Passport’s built-in testing tools or **Pest/PHPUnit** with mock services for OAuth2 libraries like League’s.
What should I do if my project requires Symfony 2.x for compliance reasons?
If compliance mandates Symfony 2.x, evaluate **LexikJWTAuthenticationBundle** for Symfony alongside an API gateway pattern to isolate Laravel from Symfony’s OAuth2 logic. Alternatively, build a minimal OAuth2 server using **league/oauth2-server** with Laravel-specific wrappers to avoid FOSOAuthServerBundle’s limitations.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware