https://github.com/codebarista/nova-webauthn
Passkey authentication for Laravel Nova
https://github.com/codebarista/nova-webauthn
authentication laravel nova php webauthn
Last synced: 4 months ago
JSON representation
Passkey authentication for Laravel Nova
- Host: GitHub
- URL: https://github.com/codebarista/nova-webauthn
- Owner: codebarista
- License: mit
- Created: 2024-02-11T19:52:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-20T22:02:56.000Z (over 1 year ago)
- Last Synced: 2025-03-20T22:33:12.879Z (over 1 year ago)
- Topics: authentication, laravel, nova, php, webauthn
- Language: Blade
- Homepage:
- Size: 59.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nova WebAuthn
[Laragear WebAuthn](https://github.com/Laragear/WebAuthn) implementation for Laravel Nova to authenticate users with
passkeys: fingerprints, patterns and biometrics.

## 1. Installation
```shell
composer require codebarista/nova-webauthn
```
## 2. Setup
Run the following command to publish and run the Laragear WebAuthn migrations.
```shell
php artisan codebarista:webauthn-setup
```
## 3. Implementation
Add the `WebAuthnAuthenticatable` contract and the `WebAuthnAuthentication` trait to the User class, or any other that
uses authentication.
```php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laragear\Webauthn\Contracts\WebAuthnAuthenticatable;
use Laragear\Webauthn\WebAuthnAuthentication;
class User extends Authenticatable implements WebAuthnAuthenticatable
{
use WebAuthnAuthentication;
// ...
}
```
Finally, add the `NovaWebauthn` registration form to the fields array of the Nova User Resource.
```php
namespace App\Nova;
use Codebarista\NovaWebauthn\NovaWebauthn;
use Laravel\Nova\Http\Requests\NovaRequest;
class User extends Resource
{
public function fields(NovaRequest $request): array
{
return [
// ...
NovaWebauthn::make(),
];
}
}
```
**Note: Make sure that passkey registration and login are done via a secure https connection.**

## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.