digitalstate/platform-sso-bundle
OroPlatform Dependency: The bundle is tightly coupled with OroPlatform (a Symfony-based CRM/ERP framework), which may not align with a vanilla Laravel architecture. Key concerns:
oro_sso_account, oro_sso_provider). Laravel’s Eloquent may need custom migrations or adapters.Oro\Bundle\SSOBundle\Event\ProviderEvent) may clash with Laravel’s event system unless bridged.Generic SSO Abstraction: The bundle’s goal of supporting multiple providers (Google, Facebook, LinkedIn, etc.) is valuable but untested (0 stars, no clear adopters). Risk of incomplete provider implementations or undocumented edge cases.
Symfony-to-Laravel Compatibility:
HttpFoundation (used in Laravel via symfony/http-foundation), OAuth2 libraries (e.g., league/oauth2-client), and event systems.symfony/bridge and symfony/dependency-injection to mimic Oro’s DI.OroSSOBundle services for Laravel’s container.routes/web.php) differs from Symfony’s YAML/XML routes.Provider-Specific Risks:
r_liteprofile scope or Facebook’s fields parameter).Session and FlashMessages; Laravel’s session() helper may need wrappers.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Breaking Changes | High | Fork the bundle; test against Laravel 10+ |
| Missing Docs | High | Reverse-engineer via Oro’s SSOBundle |
| Provider Gaps | Medium | Implement missing providers incrementally |
| Performance Overhead | Medium | Benchmark OAuth flows vs. native Laravel |
| License Ambiguity | Low | NOASSERTION → Assume permissive use |
Why OroPlatform?
socialiteproviders/socialite)?Provider Coverage
Authentication Flow
Data Mapping
email, name) mapped to Laravel’s users table?Testing
Laravel Compatibility Matrix:
| Component | Laravel Equivalent | Notes |
|---|---|---|
| Symfony DI | Laravel’s Service Container | Use Illuminate\Container wrappers |
| Oro Events | Laravel Events (event()) |
Bridge via Symfony\Contracts\EventDispatcher |
| Twig Templates | Blade (@include) |
Replace or use symfony/twig-bridge |
| Doctrine ORM | Eloquent | Custom repositories or doctrine/dbal |
| Symfony Security | Laravel Auth (auth()) |
Hybrid approach needed |
Recommended Tech Stack Additions:
league/oauth2-client (already used by Oro).symfony/http-foundation for session compatibility.pestphp/pest + mockery/mockery for provider tests.Phase 1: Dependency Isolation
composer require digitalstate/platform-sso-bundle --ignore-platform-reqs
OroSSOBundle services in config/services.php:
'providers' => [
\DigitalState\PlatformSSOBundle\Provider\GoogleProvider::class,
// Add other providers...
],
Phase 2: Laravel Integration Layer
app/Providers/SSOServiceProvider.php) to:
UserProvider to Laravel’s AuthManager.public function register()
{
$this->app->bind(\Symfony\Component\Security\Core\User\UserProviderInterface::class,
\DigitalState\PlatformSSOBundle\User\Provider::class);
}
Phase 3: Route/Controller Adaptation
Route::get('/login/{provider}', [SSOController::class, 'login']);
Route::get('/callback/{provider}', [SSOController::class, 'callback']);
SSOController to use Laravel’s auth() helper.Phase 4: Provider-Specific Configs
oro_sso.yml to Laravel’s config/sso.php:
'providers' => [
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_SECRET'),
'scopes' => ['email', 'profile'],
],
'linkedin' => [
'client_id' => env('LINKEDIN_ID'),
'scopes' => ['r_liteprofile', 'r_emailaddress'],
],
],
Critical Conflicts:
User entity to Laravel’s User model.FlashMessage with Laravel’s session()->flash().symfony/twig-bridge and configure Twig as a fallback.Workarounds:
listen() method to intercept Oro events:
Event::listen(OroSSOEvents::POST_AUTHENTICATION, function ($event) {
// Custom logic after SSO login
});
Proof of Concept (1-2 weeks)
Provider Expansion (2-3 weeks)
state parameter).Laravel Native Integration (3-4 weeks)
FlashMessages → Laravel’s session).Performance Testing (1 week)
socialiteproviders/socialite.Dependency Risks:
Customization Overhead:
How can I help you explore Laravel packages today?