This is an example use of asbiin/laravel-webauthn package.
Try this application on this live demo app.
- Just register with any email
- Then add a WebAuthn key
- Next login will ask to confirm the key
Accounts are automatically deleted after 24h on this demo instance.
In order to test the application, you need to:
-
Clone this repository
-
Install packages and configuration:
composer install npm install npm prod cp .env.example .env php artisan key:generate
-
Configure database. You can use an sqlite database, just put
DB_CONNECTION=sqlite
in the.env
file:sed -i 's/\(DB_CONNECTION\)=.*/\1=sqlite/' .env touch database/database.sqlite
-
Run a webserver
-
You'll need to point you webserver to the
public
directory. Follow instructions on the Laravel documentation. -
WebAuthn protocol requires HTTPS mode, and forbid the
localhost
url. -
Use laravel serve command, and a tool like ngrok:
php artisan serve
ngrok http http://127.0.0.1:8000
- you can use the
https
version of thengrok
output
-
Got to https://url.test/webauthn/register
to register a new key.
Author: Alexis Saettler
Copyright © 2019–2022.
Licensed under the MIT License. View license.