finds.dev

tarachandverma/nginx-openidc

Nginx module for openid-connect relying party, SSO and JWT authentication

View on GitHub

★ 79CMITupdated Jan 2022

// the take

An nginx module written in C that adds OpenID Connect relying-party login and JWT validation directly into nginx, exposing claims as X-OIDC-* headers for the backend. It targets teams who want auth enforcement at the proxy layer instead of in app code, for both browser session flows and API gateway bearer-token flows.

Handles both RP cookie-session login and pure JWT-bearer API gateway validation in the same module, which covers two very different auth patterns without needing a separate sidecar. The JWKS refresh and oidc-config.xml hot-reload (OPENIDC_RefreshWaitSeconds) means key rotation doesn't require an nginx restart, which matters for OPs that rotate signing keys. The rewrite/match_list engine lets you write per-host, per-path, per-header authorization rules declaratively instead of pushing that logic into Lua or a backend filter.

Last commit is January 2022 and it's a single-maintainer project with no CI and only a couple of ad-hoc unit-test.c files visible — for something sitting in the auth path, nearly five years of no patches is a real risk, not a nitpick. It's a static module (--add-module) built against a pinned nginx source tree (the README still shows nginx 1.14.0 from 2018), so there's no dynamic module or package repo and you end up maintaining your own nginx fork and rebuild pipeline for every nginx security update. Session cookies are protected by a hand-rolled passphrase-based encryption scheme (OPENIDC_PassPhrase) with no documented cipher, KDF, or rotation strategy, and no audited crypto library referenced — rolling your own session encryption in C is exactly where these projects tend to go quietly wrong. There's no mention of token refresh, RP-initiated logout, or PKCE, so anything beyond basic login + static JWT validation will need to be built on top.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
79
Forks
10
Language
C
License
MIT
Last commit
7 Jan 2022

// nearby

If nginx-openidc isn't quite it.

All repos →