Skip to content

lazaronixon/stimulus-web-authn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stimulus Web Authn

A Stimulus controller to implement web authn client side.

Installation

$ yarn add stimulus-web-authn

Usage

Register the controller with Stimulus:

// application.js
import { Application } from "@hotwired/stimulus"
import WebAuthnController from "stimulus-web-authn"

const application = Application.start()
application.register("web-authn", WebAuthnController)

Basic Example

<div
  data-controller="web-authn"
  data-web-authn-loading-class="web-authn-loading"
  data-web-authn-challenge-url-value="https://myapp.com/two_factor_authentication/challenge/web_authn/new"
  data-web-authn-verification-url-value="https://myapp.com/two_factor_authentication/challenge/web_authn"
  data-web-authn-fallback-url-value="/two_factor_authentication/challenge">

  <button name="button" type="button" data-web-authn-target="button" data-action="web-authn#getCredential">
    Use security key
  </button>

  <p data-web-authn-target="error" hidden></p>
</div>

👷‍♂️ Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

📝 License

This project is released under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published