litesaml/lightsaml
Lite Saml is a low-level SAML 2.0 library for PHP: data model classes, XML serialization, security and certificate support, and message bindings to build SP and IdP integrations.
Architecture fit
LiteSAML is a data model and protocol codec, not a SAML product. It gives you typed PHP classes for AuthnRequest, Response, Assertion, and Metadata; XML (de)serialization; XML-DSig signing/verification and encryption via robrichards/xmlseclibs; X.509 credential stores; and HTTP-Redirect/HTTP-POST binding encapsulation. What it deliberately does not give you is the part most teams underestimate: the SP/IdP flows (login initiation, assertion validation policy, session establishment, logout, clock skew, replay cache, attribute mapping). The README itself points at litesaml/saml for ServiceProviderWrapper/IdentityProviderWrapper, which is the honest signal that the low-level package is a component, not a solution.
Release 6.1.0 does not change this positioning. It is a key-handling correctness release: it stops inferring the signing algorithm from the certificate issuer's algorithm and instead reads the actual public key type via a new X509Certificate::getPublicKeyType() accessor. That is the right architectural fix — issuer algorithm and subject key algorithm are independent facts — but it makes the library marginally more correct without making it any more of a product. Fit assessment is unchanged: strongest where you own an application framework and want SAML inside your domain model, or where you are building an IdP/broker; weakest where the requirement is "SSO next quarter with minimal headcount."
Integration feasibility
Feasible, with two hard gates:
composer require. Confirm the runtime target first.symfony/http-foundation dependency were dropped in favour of PSR-7 interfaces. Architecturally cleaner and Laravel-compatible (Guzzle PSR-7 is already in most Laravel trees), but you write the controller glue: reading POST bodies, redirect construction, state/session persistence, and error-to-HTTP mapping.6.1.0 itself is a low-friction upgrade from 6.0.x — additive API, no removals, no namespace changes. The cost of taking it is not code, it is the interop verification described below. Positively, the package remains small, MIT-licensed, changelog-disciplined, with a public cookbook and no exotic dependencies.
Technical risk
rsa-sha1. Now: X509FileCredentialStore preserves the issuer algorithm only when it is RSA-SHA256/384/512, otherwise signs with rsa-sha256. SHA-1-issued certs now sign rsa-sha256; MD5-issued certs no longer crash; non-RSA keys (including EC certificates issued by an RSA CA) are explicitly rejected with Unsupported certificate public key type. This is correct and security-positive, but it will break partner IdPs that only accept rsa-sha1. Budget an interop cycle per federation partner.Invalid Key Type" means the library will now proceed with a certificate whose issuer chain used MD5 rather than throwing. That is desirable for legacy-format parsing, but it removes an accidental tripwire. Your onboarding policy must explicitly reject MD5-issued certificates; the library will no longer do it for you.simplesamlphp/saml2 if maintenance stalls.composer update events. Treat each major as a scoped project. Patch releases within 6.x — including 6.1.0 — are the safe cadence; majors are not.Key questions
litesaml/saml or a managed service?InResponseTo, and NotBefore/NotOnOrAfter?rsa-sha1? 6.1.0 changes the answer to "what do we sign with" for SHA-1-issued certs.Stack fit
Strong for Laravel: the PSR-7 shift aligns with Guzzle/Laravel HTTP conventions and removes the Symfony HttpFoundation assumption. Service-provider container binding is on you, but it's a handful of singletons (credential store, binding factory, entity descriptor repository). The package does not fight the framework — it simply doesn't participate in it. 6.1.0 adds nothing that needs framework glue; getPublicKeyType() is a pure value accessor, useful in your own pre-flight validation code.
Migration path
rsa-sha1 to rsa-sha256.Serializable on state classes, Symfony HttpFoundation types) are the migration work. Path: 4.7.x → 5.1.0 (security floor: XSW + duplicate assertion IDs) → current 6.1.x. Do not stop at 5.0.0 — it is the version with the XSW vulnerability.Compatibility
Pin exact versions in composer.json and the lockfile with a documented upgrade cadence. Verify ext-dom, ext-openssl, and ext-libxml in the production image. Confirm the PSR-7 implementation matches what your HTTP layer hands you — a common failure is passing a Laravel Request where a ServerRequestInterface is expected. For 6.1.0 specifically, add a compatibility check across your partner matrix: which partners validate rsa-sha1 only, and which present SHA-1-issued or ECDSA-issued certificates.
Sequencing
SamlAuthenticator interface (getLoginUrl, handleResponse, getMetadata) so the library is swappable. Highest-value long-term risk decision.InResponseTo mismatch rejected, Unsupported certificate public key type surfaced as a clean configuration error rather than a 500. Write these before production traffic.getPublicKeyType() at metadata-ingest/onboarding time to reject unsupported key types and MD5-issued chains before they reach the login path. This converts a 6.1.0 runtime rejection into a configuration-time failure.Maintenance
Low steady-state code volume, non-zero ongoing tax. Security advisories must be tracked; every IdP-initiated change (certificate rotation, metadata refresh) touches this code path. 6.1.0 raises the value of a certificate inventory: you now need to know, per partner, the issuer algorithm and key type, because the library's signing behaviour depends on both. Certificate rollover needs a runbook — expired IdP signing certs remain the single most common cause of SSO outage.
Support
No vendor. Support model is internal ownership plus upstream GitHub issues. Escalation must be explicit: who debugs a broken login at 2am, and what is the fallback (password auth? secondary IdP?) while SAML is down. Define it before go-live. Note that 6.1.0's explicit Unsupported certificate public key type error is a support asset — it makes a whole class of misconfiguration legible in logs instead of surfacing as a generic crypto failure.
Scaling
Compute cost negligible — XML signing is cheap at human-auth volumes. The real scaling concern is metadata and trust store growth: N federation partners means N certificate sets, endpoints, and now N algorithm profiles, each needing rotation handling. Above roughly a dozen partners, build a metadata registry rather than hardcoding config. Also watch session/state storage for RelayState and the request-ID correlation cache (replay prevention) — it must be shared across app instances.
Failure modes
rsa-sha1 → rsa-sha256 default change → partner rejects the signature; total login failure that appears immediately after deploy, or silently at the next certificate rotation.Unsupported certificate public key type rejection; previously a more confusing failure. Treat as a known-unsupported configuration, not a bug.Each needs an alert; expired certificates, clock skew, and algorithm mismatch need documented runbooks.
Ramp-up
The library is learnable in days; SAML is not. Expect 2–4 weeks for an engineer to become genuinely competent at debugging assertions and trusting their own validation logic — most of it on protocol and negative tests, not the API. 6.1.0 adds a specific onboarding topic that did not exist before: understanding the distinction between issuer algorithm and subject key algorithm, and why the library now cares about both. Budget an external security review. Given a ~109-star, single-maintainer project in the authentication hot path, the honest TPM position is unchanged and slightly sharpened: adopt 6.1.x over 6.0.x on security-correctness grounds, but only with an abstraction seam, a pinned version, a negative-test suite, a certificate inventory, and a named owner — or don't adopt at all.
How can I help you explore Laravel packages today?