symfony/security-bundle).spatie/laravel-symfony-support or laravel/symfony-bridge.UserManagerInterface, Firewall concepts). Laravel’s Auth system differs in structure (e.g., Guard, Provider interfaces).LightOpenId, Buzz v0.5) may introduce compatibility risks.spatie/laravel-symfony-support to port Symfony components (e.g., SecurityBundle) into Laravel.Firewall logic as Laravel middleware (e.g., SSOMiddleware).UserManagerInterface to Laravel’s UserProvider or Authenticatable contracts.routing.yml must be translated to Laravel’s routes/web.php or API routes.EventDispatcher) is absent in Laravel; alternatives like Laravel’s Events or Listeners would need mapping.LightOpenId) may conflict with modern Laravel stacks.HasApiTokens, Sanctum).symfony/security-core).Why Symfony2?
laravel/socialite or spatie/laravel-social-auth fulfill SSO needs with lower risk?Provider Support
hybridauth/hybridauth) that offer similar functionality?Auth System Compatibility
Auth::guard(), User model) interact with Symfony’s UserManagerInterface? Will custom adapters be needed?Performance/Scaling
Long-Term Viability
Target Stack:
spatie/laravel-symfony-support (for Symfony component compatibility).spatie/laravel-permission or custom User model for role management.laravel/sanctum/laravel/passport if API auth is involved.Auth system via middleware.Incompatible Components:
Firewall → Laravel Middleware.EventDispatcher → Laravel Events.UserInterface → Laravel’s Authenticatable/MustVerifyEmail.Assessment Phase:
AuthController, User model).Proof of Concept (PoC):
symfony/security-core via spatie/laravel-symfony-support).Firewall as Laravel middleware.UserManagerInterface to Laravel’s UserProvider.Firewall by calling provider APIs directly in Laravel middleware.// Laravel Middleware
public function handle(Request $request, Closure $next) {
$provider = app('benji07.sso.provider.steam');
if ($provider->authenticate()) {
$user = $provider->getUser();
auth()->login($this->createLaravelUser($user));
}
return $next($request);
}
Incremental Rollout:
Symfony Components:
| Component | Laravel Equivalent | Notes |
|---|---|---|
SecurityBundle |
spatie/laravel-symfony-support + custom |
Partial compatibility; manual mapping. |
EventDispatcher |
Laravel Events |
Use dispatch() instead of dispatcher->dispatch(). |
UserInterface |
Laravel Authenticatable |
Extend Illuminate\Foundation\Auth\User. |
Firewall |
Laravel Middleware |
Rewrite logic in handle(). |
Routing |
Laravel routes/web.php |
Convert YAML to PHP routes. |
Provider-Specific:
steamcondenser/steam-condenser) are compatible.session_name(), session_start()).Phase 1: Dependency Isolation (1-2 weeks)
Phase 2: Core Integration (2-3 weeks)
UserManagerInterface to Laravel’s UserProvider./sso/callback).Phase 3: Full Feature Parity (1-2 weeks)
Auth::login()).Phase 4: Optimization (1 week)
Redis) for provider responses.Monolog) to trace SSO flow.How can I help you explore Laravel packages today?