Weave 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

Lightsaml Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. PHP 8.4 minimum. The 5.0.0 line bumped the floor to 8.4 and added strict typing plus PHPStan level 6. On a Laravel estate pinned to 8.2/8.3, this is a platform upgrade, not a composer require. Confirm the runtime target first.
  2. Framework coupling removed, but not replaced. The Pimple bridge and 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

  • Security surface is yours. XML Signature Wrapping (fixed in 5.0.1) is the canonical SAML auth-bypass class of bug. A mature library shipping that in 5.0.0 and patching a release later is a reminder that the library is the trust boundary — pin exact versions, subscribe to advisories, re-run negative tests on every upgrade. Two CVE-adjacent fixes landed within two minor releases (XSW, duplicate/missing assertion IDs), a good response record that is also an active-attack-surface signal.
  • Key-handling semantics changed in 6.1.0. Prior to this release the signing algorithm was derived from the issuer CA, which produced two failure classes: RSA keys under an ECDSA CA were mishandled, and SHA-1-issued certificates defaulted to 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.
  • MD5 tolerance is robustness, not endorsement. "No longer fails with 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.
  • Bus factor and adoption depth. ~109 stars and a single-maintainer profile is thin for a component sitting in the authentication path. No commercial support, no SLA, no paid escalation. Mitigation: fork-and-patch capability, or a wrapper abstraction so you can swap to simplesamlphp/saml2 if maintenance stalls.
  • Low-level API churn. Repeated major versions with breaking changes mean upgrades are not 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

  • Is PHP 8.4 already in the platform baseline, or is that upgrade on the critical path?
  • Do we need low-level control (custom IdP, broker, non-standard bindings) or just "log in via Okta/Azure AD"? If the latter, why not litesaml/saml or a managed service?
  • Who owns SAML security review — can anyone on the team read an assertion and reason about XSW, audience restriction, InResponseTo, and NotBefore/NotOnOrAfter?
  • New: For every partner IdP in scope, what is the certificate issuer's algorithm versus the subject key algorithm, and does any partner accept only rsa-sha1? 6.1.0 changes the answer to "what do we sign with" for SHA-1-issued certs.
  • New: Do we have any partner whose certificate chain is MD5-signed? The library will now accept it; do we have a policy that blocks it?
  • Is a fork acceptable if upstream goes quiet, and is that written into the risk register?

Integration Approach

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

  • From 6.0.x → 6.1.0: a contained, low-risk upgrade. No API removals. The work is (a) confirming your signing algorithm choice against every partner IdP, and (b) confirming no production credential silently flips from rsa-sha1 to rsa-sha256.
  • From 4.x: the 5.0.0 removals (Pimple bridge, 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.
  • Greenfield: start on 6.1.x. Do not copy pre-5.0 samples; they won't type-check under strict typing.

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

  1. Spike (1–2 weeks): one SP-initiated login against one real IdP; prove signing, verification, and metadata parse end-to-end.
  2. Abstraction layer: define your own SamlAuthenticator interface (getLoginUrl, handleResponse, getMetadata) so the library is swappable. Highest-value long-term risk decision.
  3. Negative-test suite: unsigned response rejected, wrong audience rejected, expired assertion rejected, tampered signature rejected, duplicate assertion ID rejected, InResponseTo mismatch rejected, Unsupported certificate public key type surfaced as a clean configuration error rather than a 500. Write these before production traffic.
  4. Certificate pre-flight check: use 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.
  5. Second IdP integration: where multi-tenant and multi-algorithm reality lands.
  6. Observability and rollout: structured logging of SAML message IDs and validation outcomes (never assertions or certificates), feature-flagged rollout.

Operational Impact

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

  • Expired or rotated IdP certificate → total login failure for that partner.
  • Clock skew beyond tolerance → intermittent, user-specific failures that are hard to reproduce.
  • Algorithm mismatch after the 6.1.0 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.
  • Non-RSA / EC certificate presented by a partner → now an explicit Unsupported certificate public key type rejection; previously a more confusing failure. Treat as a known-unsupported configuration, not a bug.
  • MD5-issued partner certificate accepted → library no longer blocks it; only your policy does.
  • Signature validation edge cases regressing on a minor upgrade → auth bypass or false rejections.
  • Session/state lost on load-balanced instances → "invalid response" errors that vanish on retry.
  • Misconfigured audience/ACS URL after a domain change → silent SSO breakage.

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.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource