u2f-demo

0.2.1 • Public • Published

Universal 2nd Factor NodeJS Demo

Requirements

  • 1 U2F device (e.g. Yubikey)

Quick Start

npm install

Import keystore/server.crt into your keychain. (It's the certificate for HTTPS)

Mark the imported certificate as trusted.

npm start

Then open https://localhost:8001

dev notes

NPMs postinstall script will automatically generate the SSL certificate. But you can also generate the https server credentials manually in ./keystore directory.

openssl req -x509 -out server.crt -keyout server.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=localhost' -extensions EXT -config <( \
   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")

Further reading

For interaction between a yubikey and nodejs directly, see u2f-host-node This is beyond the sope of this demo but nice to read.

Package Sidebar

Install

npm i u2f-demo

Weekly Downloads

0

Version

0.2.1

License

ISC

Unpacked Size

36.3 kB

Total Files

18

Last publish

Collaborators

  • ablay