PHPackages                             pronin/webauthn-emulator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. pronin/webauthn-emulator

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

pronin/webauthn-emulator
========================

PHP library to emulate WebAuthn authenticators like YubiKeys, Touch ID, Face ID, Windows Hello, etc

1.2.1(10mo ago)43.3k↓50%2MITPHPPHP ^8.0

Since Apr 6Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/vadimpronin/webauthn-emulator)[ Packagist](https://packagist.org/packages/pronin/webauthn-emulator)[ RSS](/packages/pronin-webauthn-emulator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (13)Used By (0)

WebAuthn Emulator
=================

[](#webauthn-emulator)

*A simple PHP WebAuthn (FIDO2) client library*

`webauthn-emulator` is a PHP library that emulates WebAuthn-compatible authenticators like YubiKeys, Touch ID, Face ID, Windows Hello, etc. It essentially simulates the behavior of [Web Authentication API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API) of a browser, allowing the developers to integrate WebAuthn client-side authentication into their applications.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
    - [Initialization](#initialization)
    - [Registration (Attestation)](#registration-attestation)
    - [Authentication (Assertion)](#authentication-assertion)
    - [Base64url vs Base64 Encoding](#base64url-vs-base64-encoding)
- [More Examples](#more-examples)
- [Storing Credentials](#storing-credentials)
- [Testing](#testing)
- [Limitations](#limitations)
- [Contributing and Reporting Issues](#contributing-and-reporting-issues)
- [License](#license)
- [Acknowledgments](#acknowledgments)

Features
--------

[](#features)

- Generate responses for WebAuthn registration (attestation) and authentication (assertion) requests.
- Works with any key storage.
- Supports multiple users and credentials.

Installation
------------

[](#installation)

The recommended way to install `webauthn-emulator` is through [Composer](https://getcomposer.org/):

```
composer require pronin/webauthn-emulator
```

Quick Start
-----------

[](#quick-start)

After installing `webauthn-emulator` via Composer, you can quickly begin by creating an instance of the `Authenticator`class and using it to handle WebAuthn registration and authentication.

Initialize the authenticator:

```
