@sonicgarden/webauthn-elements
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

<webauthn> elements

This package provides two custom HTML elements for WebAuthn registration(webauthn-registration) and WebAuthn login(webauthn-login). WebAuthn is a web standard for authenticating users using public key credentials. These custom elements are designed to easily integrate the WebAuthn registration and login process.

Installation

Available on npm as @sonicgarden/webauthn-elements.

$ npm install --save @sonicgarden/webauthn-elements

Usage

Script

Import as ES modules:

import '@sonicgarden/webauthn-elements'

These custom elements can be used within HTML forms. The registration and login process is triggered by the form's submit event.

<!-- Registration -->
<form method="post">
  <webauthn-registration name="credential" options="PublicKeyCredentialCreationOptionsJSON"></webauthn-registration>
  <button type="submit">Register</button>
</form>

<!-- Login -->
<form method="post">
  <webauthn-login name="credential" options="PublicKeyCredentialRequestOptionsJSON"></webauthn-login>
  <button type="submit">Login</button>
</form>

Events

  • unsupported: Triggered during the connectedCallback timing if the browser does not support WebAuthn.
  • error: Triggered when the authentication dialog is cancelled, etc.

License

Distributed under the MIT license. See LICENSE for details.

Readme

Keywords

none

Package Sidebar

Install

npm i @sonicgarden/webauthn-elements

Weekly Downloads

79

Version

0.2.2

License

MIT

Unpacked Size

6.73 kB

Total Files

4

Last publish

Collaborators

  • latica.jp
  • aki77
  • mat_aki
  • tochi
  • interu
  • t-kojima
  • kontikun
  • hiropon