spomky-labs/u2f-php
spomky-labs/u2f-php is a PHP library for implementing U2F (FIDO Universal 2nd Factor) authentication. It helps register and verify hardware security keys on the server, adding strong two-factor login protection to PHP applications and integrating with the WebAuthn ecosystem.
Consider it only in a narrow, mostly legacy context:
Look elsewhere when:
spomky-labs/u2f-php is archived (last meaningful activity years ago, ~27 stars, minimal community). The same author's web-auth/webauthn-lib is the maintained successor and speaks FIDO2/WebAuthn and can consume U2F attestation formats — it is the correct default.u2f-api.js / navigator.u2f client API has been removed from modern Chrome and is unavailable in current Safari/Firefox. Server-side U2F verification still works for pre-existing registrations, but you cannot register new U2F tokens through the browser without going through WebAuthn. If your plan is "ship keys to new users," this package alone cannot deliver it.To executives: This is a small, free (MIT), self-hosted library that lets us accept hardware security keys as a second factor — the phishing-resistant kind auditors ask about for privileged access and payment approvals. The strategic caveat is that it is archived and unmaintained, and the underlying U2F protocol has been superseded by WebAuthn/passkeys in every major browser. My recommendation is to treat it as a bridge, not a destination: fund a WebAuthn implementation (likely the maintained sibling library, web-auth/webauthn-lib) and use this package only to keep existing registered keys working during the transition. The cost of the wrong choice here is not license fees — it is an unpatched authentication dependency on the login path, plus a forced re-enrollment of every user with a key. Budget a short spike to inventory existing U2F registrations; that number decides whether we need a compatibility window at all.
To engineering: Treat it as read-only reference material and a stopgap. It gives you correct U2F registration/authentication verification and counter handling, but it is archived, has a tiny contributor base, and will not track PHP releases or security fixes — so any adoption implies forking, pinning, and owning it. Do not build new enrollment flows on it: the legacy browser U2F API is gone, so new registrations must go through WebAuthn (which can still register and then verify U2F-capable keys via attestation formats). Concretely: audit the credential table for existing U2F rows, stand up web-auth/webauthn-lib behind the same interface, dual-read during migration, then retire U2F verification once the last legacy key re-enrolls. Flag the fork to security for CVE monitoring if any legacy verification must persist beyond one quarter.
How can I help you explore Laravel packages today?