npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-red-contrib-webauthn-variable

v1.0.2

Published

WebAuthn actions for Node-RED (in-process, no HTTP server)

Readme

node-red-contrib-webauthn-variable

WebAuthn registration and authentication operations for Node-RED, executed directly inside the Node-RED runtime with @simplewebauthn/server.

The node does not start an HTTP server and does not open any network ports. It can be connected to existing Node-RED HTTP, database, session, and Redis nodes.

Features

  • Generate WebAuthn registration options
  • Verify WebAuthn registration responses
  • Generate WebAuthn authentication options
  • Verify WebAuthn authentication assertions
  • Restrict allowed origins and RP IDs
  • Accept input from msg.payload or another message path
  • Separate success and error outputs
  • Return credential metadata such as transports, attachment modality, AAGUID, device type, and backup state when available

Requirements

  • Node.js 18 or newer
  • A WebAuthn-capable browser
  • HTTPS, except for browser-supported localhost development

Installation

Install from the Node-RED user directory:

cd ~/.node-red
npm install node-red-contrib-webauthn-variable

Restart Node-RED after installation.

Node configuration

The package adds the webauthn-actions node to the security category.

  • RP Name: Human-readable relying-party name used during registration.
  • Default Action: Operation performed when no dynamic action is supplied.
  • Body source: Read the request from msg.payload or another message path.
  • Allowed Origins: Optional comma-separated allowlist such as https://example.com.
  • Allowed RP IDs: Optional comma-separated allowlist such as example.com.

The configured action can be overridden for each message:

msg.webauthn = {
    action: "verify-authentication"
};

Supported actions

generate-registration-options

Generates options for navigator.credentials.create().

verify-registration

Verifies the response returned by navigator.credentials.create() and returns the credential ID, public key, counter, and available authenticator metadata.

generate-authentication-options

Generates options for navigator.credentials.get() using registered credential IDs or credential descriptors.

verify-authentication

Verifies an authentication assertion using the stored credential public key and signature counter.

Outputs

The node has two outputs:

  1. ok — the operation completed and msg.payload.ok === true.
  2. error — validation or WebAuthn verification failed.

Successful registration verification can include:

{
  "ok": true,
  "credential": {
    "credentialId": "base64url credential id",
    "credentialPublicKey": "base64url COSE public key",
    "counter": 0,
    "transports": [],
    "authenticatorAttachment": "cross-platform",
    "aaguid": "00000000-0000-0000-0000-000000000000",
    "credentialDeviceType": "singleDevice",
    "credentialBackedUp": false
  }
}

Authenticator metadata is optional. In particular, an empty transports array is valid and means that the browser did not provide transport information.

Security responsibilities

This node performs WebAuthn option generation and cryptographic verification. The surrounding flow must also:

  • Generate a new challenge for every ceremony
  • Store challenges server-side with a short expiration time
  • Bind each challenge to the correct user, RP ID, and operation
  • Consume each challenge exactly once
  • Store credential IDs, public keys, counters, and metadata in a database
  • Update the signature counter after successful authentication
  • Use fixed or allowlisted origins and RP IDs
  • Require user verification when appropriate
  • Return authentication success only after cryptographic verification succeeds

Do not trust credential IDs, authenticator attachment values, transports, or other client-supplied metadata as proof of a particular device model. Use verified attestation and a suitable metadata policy when hardware provenance is required.

License

MIT