Download the PHP package scriptoshi/livewire-webauthn without Composer

On this page you can find all versions of the php package scriptoshi/livewire-webauthn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package livewire-webauthn

Laravel Livewire WebAuthn

A modern WebAuthn (FIDO2) authentication package for Laravel 12 using Livewire and Flux components. Enables passwordless and two-factor authentication using security keys, biometrics, and mobile devices.

Overview

Laravel Livewire WebAuthn provides an easy way to integrate WebAuthn (Web Authentication) capabilities into your Laravel 12 application. Built with Livewire and Flux components, it offers a modern, interactive user experience with minimal configuration.

Features

Requirements

Installation

1. Install the package via Composer

2. (Optional) Publish the assets if you need to customize them

3. Run the migrations

This will add the required columns to your users table and create the credentials table.

4. Include the WebAuthnAuthenticatable trait in your User model

Configuration

The package comes with sensible defaults, but you can customize it using the corresponding .env variables. Add the following lines to your .env to customize the configuration:

Basic Usage

Integrating with Login as Second factor Auth.

Add the middleware to intercept your login logic. Note: this is the route for POST when users submit the login form. In volt components this route is missing !.

  1. Add this to your routes/web.php:

Adding WebAuthn Management to User Profile

Add the Livewire component to your user profile or settings page:

With Laravel 12 Starter Kit, you can add a new section for WebAuthn management:

  1. Edit resources/views/components/settings/layout.blade.php to add the menu item:

  2. Then Create a WebAuthn view: resources/views/livewire/settings/webauthn.blade.php

  3. Add the route to routes/web.php:

That's it! The component will handle registering, managing, and using WebAuthn credentials.

Configure Tailwind CSS

To ensure that Tailwind CSS properly processes the component styles, add this package to your content sources in your CSS file (typically resources/css/app.css):

For example, your CSS file might look similar to this:

Using WebAuthn Confirmation Modals

For enhanced security, you can require WebAuthn confirmation for sensitive operations. This is similar to password confirmation but uses a security key or biometric instead. You can then call call $this->ensureWebAuthnIsConfirmed(); before performing any critical actions.

  1. Include the trait in your Livewire component:

  2. In the components blade, Wrap the sensitive action.

Advanced Usage

Using the Facade Directly

You can use the WebAuthn facade directly for advanced use cases:

Event Handling

The package dispatches Livewire events that you can listen for:

Use these events in your Livewire components to respond to WebAuthn actions.

Client-Side Implementation

The package includes all necessary JavaScript for interacting with the WebAuthn API. The included functions handle:

  1. Base64 URL Encoding/Decoding: Converts between ArrayBuffer and Base64URL format
  2. Credential Registration: Handles the WebAuthn credential creation process
  3. Credential Authentication: Handles the WebAuthn assertion process
  4. Error Handling: Manages and logs WebAuthn errors

Security Considerations

Browser Compatibility

WebAuthn is supported in all major modern browsers:

Mobile support:

Troubleshooting

Common Issues

  1. "navigator.credentials is undefined": The browser doesn't support WebAuthn or the page isn't served over HTTPS.
  2. "SecurityError": The origin or relying party ID configuration is incorrect or the request is not made from a secure context.
  3. "Not allowed error": The user rejected the request or the authenticator is already registered.

SSL Requirements

WebAuthn requires HTTPS in production. For local development, localhost is considered a secure context by most browsers.

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This package is open-sourced software licensed under the MIT license.


All versions of livewire-webauthn with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0
livewire/livewire Version ^3.0
web-auth/webauthn-lib Version ^5.1
ramsey/uuid Version ^4.7
symfony/serializer Version ^7.0
symfony/property-access Version ^7.0
symfony/property-info Version ^7.0
symfony/clock Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package scriptoshi/livewire-webauthn contains the following files

Loading the files please wait ....