Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
/ fido2-middleware Public archive

🔑 A middleware implementation of fido2 for Express.

License

Notifications You must be signed in to change notification settings

kg0r0/fido2-middleware

Repository files navigation

fido2-middleware

Build Status Coverage Status All Contributors npm version License CI Quality Gate Status

Install

$ npm i fido2-middleware

Usage

const express = require('express');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const cookieSession = require('cookie-session');
const fido2middleware = require('fido2-middleware');
const crypto = require('crypto');
const app = express();

app.use(cookieParser());
app.use(bodyParser.json());
app.use(cookieSession({
  name: 'session',
  keys: [crypto.randomBytes(32).toString('hex')],
  maxAge: 24 * 60 * 60 * 1000
}));
app.use(fido2middleware.webAuthentication);

Configuration

Fido2-middleware reads configuration files in the ./config directory for the running process, typically the application root. Place the following files in the config directory:

{
    "fido2-middlewareConfig": {
        "fido2lib": {
            "timeout": 60000,
            "rpId": "localhost",
            "challengeSize": 32
        },
        "origin": "https://localhost:3000",
        "factor": "either"
    }
}

Example

$ cd example
$ npm install
$ npm start

Access to https://localhost:3000/.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

shiv3
shiv3

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

About

🔑 A middleware implementation of fido2 for Express.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •