qmetrics.net

jsonwebtoken

Node.js library for signing and verifying JSON Web Tokens

jsonwebtoken implements JWT creation and verification for Node.js using HMAC, RSA, ECDSA, and related algorithms. It exposes sign, verify, and decode helpers built on node-jws.

Overview

The jsonwebtoken package is a Node.js implementation of JSON Web Tokens for issuing and checking compact, signed tokens. It wraps node-jws and was developed against early OAuth JWT drafts, with APIs familiar to JavaScript backends and services.

jwt.sign accepts object, string, or buffer payloads and returns a serialized token, applying algorithms such as HS256 by default or asymmetric RSA and ECDSA keys when configured. Options cover standard claims like expiration, not-before, audience, issuer, subject, and jwtid, plus header customization and optional payload mutation before encoding.

jwt.verify validates signatures and optional claim constraints such as expiry, audience, and issuer, synchronously or with callbacks. Failures surface typed errors including TokenExpiredError, JsonWebTokenError, and NotBeforeError. jwt.decode reads payload data without signature validation and is documented as unsafe for untrusted input.

The library documents supported JWA algorithms from symmetric HMAC through RSA, PSS, and ECDSA, with guidance on key sizes and verification options such as clock tolerance. It is maintained by Auth0 and consumed as a dependency in authentication and API authorization stacks.

Key features

  • JWT sign and verify APIs
  • HMAC and asymmetric algorithms
  • Standard claim options
  • Sync and async verification
  • Typed verification errors
  • Decode without verify helper
  • Custom JWT headers
  • Clock tolerance for exp/nbf

Use cases

  • API bearer token authentication
  • Session tokens for web services
  • Signed authorization between microservices
  • Testing JWT claim handling in Node apps
  • Integrating with OAuth-style flows

Similar software

Auth.js

Web authentication libraries for JavaScript frameworks

Auth.js (NextAuth) adds sign-in, sessions, and OAuth to modern JavaScript apps. Packages target Next.js, SvelteKit, Express, Qwik, and other runtimes.

★ 28.4k⟳ 4 months agoISC

Devise

Modular authentication engine for Ruby on Rails

Devise adds sign-in, registration, and related account flows to Rails apps through a Warden-backed engine. Teams enable only the authentication modules they need for each user model.

★ 24.3k⟳ 1 month agoMIT

JustAuth

Java library for third-party OAuth login

JustAuth is a Java component that wires social and enterprise OAuth providers into applications without vendor-specific SDKs. It exposes a small API with builder-style configuration.

★ 17.6k⟳ 1 year agoMIT
Identity & Access Management (IAM)No commits in 18+ monthsDesktop/CLI app

laravel-permission

Database-backed roles and permissions for Laravel applications

Laravel Permission stores roles and permissions in the database and wires them to users, guards, and Laravel’s authorization gate.

★ 13k⟳ 2 days agoMIT

CASL

Isomorphic TypeScript authorization for apps and APIs

CASL limits which resources a user may access using declarative rules shared across frontend, backend, and database layers.

★ 7.1k⟳ 4 days agoMIT

Doorkeeper

OAuth 2.0 authorization server for Ruby on Rails and Grape

Doorkeeper is a Ruby gem that adds OAuth 2 provider features to Rails or Grape applications.

★ 5.5k⟳ yesterdayMIT