@rui13araujo/yawebauthn-server
v1.2.1
Published
Yet Another WebAuthn Module
Downloads
8
Readme
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
});