lightsaml/sp-bundle
Symfony bundle that adds SAML 2.0 Service Provider support via LightSAML. Configure SSO login/logout, consume IdP metadata, and validate assertions with minimal setup—ideal for adding enterprise single sign-on to Symfony applications.
Architecture fit — poor as published, salvageable only at the library layer. lightsaml/sp-bundle is a Symfony bundle, not a framework-neutral library. It assumes Symfony's DI container, FrameworkBundle config tree, EventDispatcher, HttpKernel request/response cycle, and Symfony routing for its ACS/metadata endpoints. Laravel exposes analogous but non-interchangeable primitives (service providers, config/*.php, middleware, Route). There is no supported path to composer require this into a Laravel app — the bundle's bootstrapping contract simply does not exist there. The only realistic leverage is dropping to the underlying lightsaml/lightsaml core and re-implementing the SP orchestration (AuthnRequest generation, Response/Assertion validation, metadata parsing) inside Laravel-native services. At that point you have adopted the dependency, not the package — which changes the value proposition entirely.
Integration feasibility — low. Three compounding problems:
--ignore-platform-reqs, PHP 8 removed/changed behavior that 2019-era code paths rely on. Expect fatal errors or silent deprecation noise.Technical risk — high, concentrated in security and longevity. A 2019-frozen SAML implementation is the wrong risk profile for an authentication boundary. lightsaml/lightsaml itself is effectively dormant, so the bundle cannot inherit fixes from below. The 64 stars / 0 dependents signal is a proxy for "no community to catch regressions." A POC will probably work against one IdP, which is precisely the failure mode: it validates the happy path and hides the maintenance liability.
Key questions to resolve before committing:
Recommendation: do not adopt the bundle. Evaluate framework-agnostic alternatives (SAML-Toolkits/php-saml, actively maintained OneLogin lineage) or a managed IdP-brokered approach (Auth0/WorkOS/Okta as the SAML terminator, OIDC into Laravel). Budget the build vs. buy decision before writing any code.
Stack fit. None at the bundle level. If the SAML requirement is non-negotiable and we self-host, the correct shape is: framework-neutral SAML library → thin Laravel adapter (service provider + config + auth guard + middleware) → our own routes for ACS, metadata, and login initiation. That adapter is ~2–4 dev-weeks of well-scoped work regardless of which library sits underneath, so the library choice should be driven by maintenance posture, not by bundle convenience.
Migration path. If anything is already running on the Symfony bundle (unlikely given 0 dependents, but confirm), the port is a config extraction exercise: SP entity ID, ACS URL, signing/decryption certs and keys, IdP metadata XML or URL, attribute mapping. All of that is portable. What is not portable is any code that touched the bundle's services or its Symfony event hooks — that gets rewritten. Assume a lift-and-rewrite of the integration layer, preserving only configuration and certificate material.
Compatibility. Hard blockers: PHP 8.x runtime, Symfony 5/6/7 component versions, and PSR/symfony/http-foundation version drift between the bundle's era and current Laravel. Soft blockers: no Laravel-native session handling for AuthnRequest ID correlation and RelayState — you must own that store explicitly, keyed to survive multiple app nodes.
Sequencing (if we proceed at all):
InResponseTo/NotOnOrAfter checks, XXE posture, replay cache.If step 2 or 3 fails, pivot to managed brokering — that decision is cheapest at week three.
Maintenance. This is the decisive factor. An unmaintained 2019 auth dependency transfers the entire patch burden to us: we become the de facto maintainer of a fork, on a security-critical path, with no upstream. That is a permanent headcount tax, not a one-time integration cost. Every PHP minor bump becomes a compatibility audit. Compare against an actively maintained library where the same audit is someone else's job.
Support. Zero. No maintainer response, no CVE feed, no upgrade guide. Internal support means whoever built the adapter owns it indefinitely — a bus-factor-of-one risk that should be documented explicitly.
Scaling. SAML itself scales fine (stateless per-request validation). The scaling hazard is our own state: pending AuthnRequest IDs and RelayState must live in a shared store (Redis) with TTLs — sticky sessions will not survive autoscaling or rolling deploys. Metadata caching must be shared too, or every node hammers the IdP's metadata endpoint and risks throttling. Neither concern is handled for us.
Failure modes to plan for:
Ramp-up. SAML is a specialty skill; the team's general Laravel fluency does not transfer. Expect 1–2 weeks of genuine ramp per engineer, plus access to IdP admin consoles for both test and production tenants. Testing requires a real IdP sandbox (Azure AD free tier, Okta developer) — SAMLtest.id is useful for smoke tests but insufficient for signature/encryption edge cases. Budget that environment setup into the plan, not after it.
Bottom line for the product decision: the integration cost is roughly the same whether we build on this bundle's core or on a maintained alternative, but the run-rate cost is not. Recommend rejecting lightsaml/sp-bundle and spending the same engineering budget on a maintained library or a managed broker.
How can I help you explore Laravel packages today?