pronin/webauthn-emulator
A PHP library that emulates WebAuthn authenticators for testing: generate attestation and assertion responses, simulate security keys, and exercise registration and login flows in Laravel and plain PHP test suites without hardware.
What the package is. pronin/webauthn-emulator is not a Laravel package and not a runtime authentication component. It is a framework-agnostic PHP test double that constructs WebAuthn ceremony artifacts — client data, authenticator data, attestation objects, and signed assertions — so a relying party's registration and authentication endpoints can be exercised without physical YubiKeys, Touch ID, or Windows Hello hardware. There is no service provider, facade, config file, or migration.
Architecture fit. It belongs in the verification layer of a WebAuthn relying party, alongside (not instead of) a server-side library such as web-auth/webauthn-lib. It substitutes for the authenticator, not the verifier. That makes it a require-dev concern living under tests/, consumed by feature tests that POST to your /webauthn/register and /webauthn/login endpoints. It does not remove the need for at least one real-browser, real-authenticator end-to-end check per release, because emulator-generated artifacts bypass the JS navigator.credentials path entirely.
Integration feasibility. Low effort on the surface: MIT license, Composer-installable, PSR-4 autoloading, no infrastructure. The real work is alignment — matching its supported attestation statement formats (none, packed, fido-u2f, TPM, Android Key) and COSE algorithms (ES256, RS256, EdDSA) to what your verifier actually accepts, and to the PHP/OpenSSL versions in CI.
Technical risk. Production risk is effectively zero — it never enters a request path. The risks are contained to test integrity:
Key questions. Does it support the specific attestation formats and algorithms our verifier enforces? Which PHP versions are supported, and do they cover our matrix? Can it deliberately produce invalid artifacts (bad signature, wrong origin, wrong rpId, regressed sign counter, replayed challenge) — negative testing is where most of the value is? Does it emulate platform authenticators distinctly from roaming ones, including the uv/up flag combinations we branch on? Is the repo actively released, and what is the last commit date relative to our web-auth/webauthn-lib pin? Does it emit CBOR that round-trips through the same decoder we use in production?
Stack fit. Laravel 9/10/11 are all fine provided the PHP constraint matches; there is nothing Laravel-specific to wire up. Install with composer require --dev pronin/webauthn-emulator, pin an exact version (not a caret range) in composer.lock, and keep it out of the production image build.
Migration path. If the team currently maintains hand-written attestation JSON fixtures or recorded ceremony payloads, replace them incrementally rather than wholesale: introduce the emulator for new test cases first, keep existing fixtures green, and retire them once parity is demonstrated. Preserve at least one genuine browser-driven test as a permanent canary.
Compatibility. Pin the emulator to the same web-auth/webauthn-lib major version in use, and verify OpenSSL, gmp/bcmath, and sodium extensions are present in every CI image. Validate against the oldest and newest PHP in the support matrix before merging.
Sequencing.
WebAuthnEmulatorFactory test helper wrapping the library — so the vendor package is referenced from exactly one place.make:test-style generator or shared trait so product engineers don't hand-assemble ceremony objects.Maintenance. No runtime maintenance, but this becomes load-bearing for CI: a broken transitive update blocks every PR touching auth. Own it explicitly — assign a named maintainer, review release notes on upgrade, and be prepared to fork and vendor into packages/ if the upstream goes quiet. Budget roughly a day per year for upgrade validation plus the initial ramp.
Support. No upstream support channel and no security process — which is acceptable precisely because it is never deployed. Internal ownership is the only support model; document the adapter's contract in the repo.
Scaling. No production scaling implications. Test-suite scaling is the only concern: per-test key generation is comparatively expensive, so generate keypairs once per test class where isolation permits, or cache deterministic fixtures for the happy path.
Failure modes.
Ramp-up. Engineers need working fluency in WebAuthn ceremony structure — clientDataJSON, authenticator data flags, CBOR-encoded attestation objects, challenge lifecycle. Estimate one to two days for a mid-level engineer already comfortable with the spec, materially more without it. Given the score and adoption signals, the defensible position is adopt with containment: acceptable as a tactical test accelerant behind a one-file adapter, not as a strategic dependency — and reassess against building minimal in-house fixtures if the surface area you actually need is small.
How can I help you explore Laravel packages today?