@rui13araujo/yawebauthn-server

1.2.1 • Public • Published

yawebauthn-server

Yet Another WebAuthn Package for the Server

Install

npm i @rui13araujo/yawebauthn-server

Usage

Attestation (Register)

const yawebauthn = require('@rui13araujo/yawebauthn-server');

const attestationRequest = yawebauthn.attestation.request({
  rpId: 'localhost',
  rpName: 'Test',
  username: user.username,
  name: user.name,
  userId: user.userId,
  authenticators: user.authenticators
});

const attestationResponse = yawebauthn.attestation.response({
  rpId: 'localhost',
  challenge,
  origin: 'http://localhost:3000',
  webAuthnResponse: request.body
});

Assertion (Login)

const yawebauthn = require('@rui13araujo/yawebauthn-server');

const assertionRequest = yawebauthn.assertion.request({
  rpId: 'localhost',
  authenticators: user.authenticators
});

const assertionResponse = yawebauthn.assertion.response({
  rpId: 'localhost',
  challenge: '<REQUEST CHALLENGE>',
  origin: 'http://localhost:3000',
  webAuthnResponse: request.body,
  authenticator
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @rui13araujo/yawebauthn-server

Weekly Downloads

0

Version

1.2.1

License

ISC

Unpacked Size

672 kB

Total Files

3

Last publish

Collaborators

  • rui13araujo