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 yarn install yarn run build cp .env.example .env php artisan key:generate
-
Configure database. You can use an sqlite database, just put
DB_CONNECTION=sqlitein the.envfile:sed -i 's/\(DB_CONNECTION\)=.*/\1=sqlite/' .env touch database/database.sqlite -
Migrate database and setup the environment.
php artisan setup
-
Run a webserver
-
You'll need to point you webserver to the
publicdirectory. Follow instructions on the Laravel documentation. -
WebAuthn protocol requires HTTPS mode, and forbid the
localhosturl. -
Use laravel serve command, and a tool like ngrok:
php artisan servengrok http http://127.0.0.1:8000- you can use the
httpsversion of thengrokoutput
-
Got to https://url.test/webauthn/register to register a new key.
Author: Alexis Saettler
Copyright © 2019–2024.
Licensed under the MIT License. View license.