Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/madwizard-org/webauthn-server
WebAuthn Relying Party server library for PHP
https://github.com/madwizard-org/webauthn-server
2fa fido fido-u2f fido2 php relying-party two-factor-authentication u2f webauthn
Last synced: about 1 month ago
JSON representation
WebAuthn Relying Party server library for PHP
- Host: GitHub
- URL: https://github.com/madwizard-org/webauthn-server
- Owner: madwizard-org
- License: mit
- Created: 2018-06-09T18:32:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-14T14:30:19.000Z (about 1 year ago)
- Last Synced: 2024-04-26T21:47:52.607Z (8 months ago)
- Topics: 2fa, fido, fido-u2f, fido2, php, relying-party, two-factor-authentication, u2f, webauthn
- Language: PHP
- Homepage:
- Size: 767 KB
- Stars: 45
- Watchers: 6
- Forks: 10
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-webauthn - Madwizard.org: WebAuthn PHP library - WebAuthn server library for PHP. (Server Libraries)
README
# WebAuthn Relying Party server library for PHP
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/madwizard-org/webauthn-server/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/madwizard-org/webauthn-server/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/madwizard-org/webauthn-server/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/madwizard-org/webauthn-server/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/madwizard-org/webauthn-server/badges/build.png?b=master)](https://scrutinizer-ci.com/g/madwizard-org/webauthn-server/build-status/master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)## Current state
Pretty stable but the API may still change slightly until the 1.0 release.
## Goal
This library aims to implement the relying party server of the WebAuthn specification in PHP. Important goals are:
- Implement the level 1 WebAuthn specification
- Good quality, secure and maintainable code
- Easy to use for the end-user## Installation
Installation via composer:
```bash
composer require madwizard/webauthn
```## Supported features
- > PHP 7.2
- FIDO conformant library
- Attestation types:
- FIDO U2F
- Packed
- TPM
- Android SafetyNet
- Android Key
- Apple
- None
- Optional 'unsupported' type to handle future types
- Metadata service support
- Validating metadata
- Extensions:
- appid## Usage
The library is still in development so documentation is limited. The general pattern to follow is:
1. Implement `CredentialStoreInterface` (you will need `UserCredential` or your own implementation of `UserCredentialInterface`)
2. Create an instance of `RelyingParty` and use the `ServerBuilder` class to build a server object:
```php
$server = (new ServerBuilder())
->setRelyingParty($rp)
->setCredentialStore($store)
->build();
```
3. Use `startRegistration`/`finishRegistration` to register credentials. Be sure to store the temporary `AttestationContext` server side!
4. and `startAuthentication`/`finishAuthentication` to authenticate. Be sure to store the temporary `AssertionContext` server side!## Resources
[WebAuthn specification](https://www.w3.org/TR/webauthn/)