openid-client

Certified OAuth 2 and OpenID Connect client for every modern JavaScript runtime.

Library
npm
v6.8.8
2,435 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 92
Maintenance 96
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
91 /100 Excellent
Architecture 90
Code Quality 95
Innovation 88
Learning Curve 70

openid-client is a certified OAuth 2 and OpenID Connect relying-party library that simplifies integrating with authorization servers across JavaScript runtimes including Node.js, Deno, Bun, browsers, Cloudflare Workers, and Electron. It provides small, composable functions for the most common authentication and authorization flows — Authorization Code with PKCE, Refresh Token, Device Authorization, CIBA, and Client Credentials.

Built on the Web Crypto and Fetch APIs, it ships first-class support for advanced security profiles such as FAPI 1.0/2.0, DPoP, PAR, JAR, JARM, token introspection and revocation, dynamic client registration, and a ready-made Passport strategy, making it a dependable foundation for standards-compliant identity integrations.

What You Get

  • Authorization Server Metadata discovery and issuer identification
  • Authorization Code Flow with mandatory PKCE plus Refresh Token, Device Authorization, CIBA, and Client Credentials grants
  • Advanced security extensions: DPoP, PAR, JAR, JARM, and FAPI 1.0/2.0 conformance
  • Token introspection and revocation, UserInfo and protected-resource requests, and dynamic client registration
  • A drop-in Passport strategy and universal runtime support (Node.js, Deno, Bun, browsers, Cloudflare Workers, Electron)

Common Use Cases

  • Adding Sign in with an OpenID Provider (Auth0, Okta, Keycloak, Entra ID) to a web app
  • Implementing the Device Authorization Grant for CLIs, TVs, and input-constrained devices
  • Building FAPI-compliant clients for open banking and other high-assurance integrations

Under The Hood

Architecture

The library is organized as a flat set of exported functions in src/index.ts (~4,475 lines) rather than a class hierarchy. A Configuration object produced by discovery() holds server metadata and client credentials, and per-configuration internal state (auth method, DPoP/JARM/decrypt handlers, JWKS cache) is stashed in a module-level WeakMap (props) accessed via the int() helper, keeping private state off the public surface. Each flow — buildAuthorizationUrl, authorizationCodeGrant, initiateDeviceAuthorization/pollDeviceAuthorizationGrant, clientCredentialsGrant — delegates the underlying RFC-conformant HTTP and token-validation work to the oauth4webapi primitive layer, with openid-client providing the higher-level, ergonomic orchestration. A separate src/passport.ts (~732 lines) wraps these functions into a Passport Strategy.

Tech Stack

Written in TypeScript (94% of the codebase) and distributed as pure ESM (with require(esm) interop on modern Node). Runtime dependencies are minimal and sharply scoped: oauth4webapi for the low-level OAuth/OIDC protocol primitives and jose for JWE decryption. It relies on standard Web Platform globals (WebCryptoAPI, Fetch) rather than Node built-ins, which is what enables universal runtime support. Build is via esbuild/ts-blank-space; docs via TypeDoc.

Code Quality

The repository is mature and rigorously tested. Unit tests live in test/ (dcr, decryption, generic-grant, issuer-check, passport, retry-after, and regression tests for specific issues) using AVA, and an extensive end-to-end conformance harness in tap/ runs the same suite across Node.js, Deno, Bun, browsers, Cloudflare Workers, and Electron against a real oidc-provider. The author has formally certified the library against OpenID Connect Basic, FAPI 1.0, and FAPI 2.0 Relying Party conformance profiles, and a documented Security Policy is maintained.

API Design The public API favors small, explicit, single-purpose functions over a stateful client object, which keeps tree-shaking effective (sideEffects: false) and makes each flow readable. TypeScript types are thorough and the TypeDoc-generated reference plus a rich examples/ directory (oauth, oidc, dpop, jar, jarm, par, passport) mean common flows are copy-paste ready. The trade-off is that OAuth/OIDC domain knowledge is still required — the surface is broad because the protocol is — but naming is consistent and PKCE/state handling is guided by the docs.

Used by 24 apps in this directory

TypeScript
99%
MIT

GraphQL Hive

Developer Tools · Devops · Monitoring

483

Open-source GraphQL schema registry and observability platform with breaking change detection, federation support, and CI/CD integration for teams of any size.

View details
90
Repo Health
81
Technical
68
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
TypeScript
62%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,978

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 62%
Svelte 34%
Updated 1 weeks ago
TypeScript
96%
Other

Infisical

Devops · Security

29,961

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 96%
Updated 6 days ago
JavaScript
46%
MIT

Kutt

Analytics · Marketing

11,166

Self-hosted URL shortener with custom domains, per-link analytics, and zero build step required.

View details
68
Repo Health
62
Technical
71
Dependency
Built with
JavaScript 46%
Handlebars 24%
HTML 16%
Updated 1 weeks ago
TypeScript
85%
MIT

LibreChat

AI Assistants · Developer Tools

46,236

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
62
Dependency
Built with
TypeScript 85%
JavaScript 14%
Updated 6 days ago
TypeScript
97%
Other

Lightdash

Analytics · Data Engineering

6,196

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
96%
Apache 2.0

OneUptime

Monitoring

7,751

The complete open-source observability platform that replaces PagerDuty, Datadog, Sentry, and StatusPage with a single self-hostable system.

View details
91
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
82%
Apache 2.0

Palmr.

File Storage · Security

2,395

Self-hosted, privacy-focused file sharing without limits

View details
57
Repo Health
62
Technical
68
Dependency
Built with
TypeScript 82%
MDX 13%
Updated 2 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers