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

@sviy/authglue

v1.0.8

Published

OIDC auth glue for Express apps

Readme

@sviy/authglue

OIDC authentication glue for Express apps.

Wraps into a single setup call : openid-client and express-session

Your app redirects to any OIDC provider, handles the callback, creates a session, and gives you back req.session.user. No auth boilerplate per app.

Install

npm install @sviy/authglue

Dependencies

  • openid-client — OIDC client library
  • express-session — session middleware
  • @sequencemedia/session-file-store — file-based session store

Known Socket Alerts

Socket.dev reports a "Uses eval" alert from [email protected], a transitive dependency of express-session. This is a false positive — depd uses the Function constructor for deprecation wrapper generation, not eval() on external input. depd is used by 142M weekly downloads across the Express ecosystem and has no known vulnerabilities.

Usage

import express from 'express';
import { setupAuth } from '@sviy/authglue';

const app = express();

const requireAuth = await setupAuth(app, {
  issuerUrl: process.env.IDP_ISSUER,
  clientId: process.env.IDP_CLIENT_ID,
  clientSecret: process.env.IDP_CLIENT_SECRET,
  callbackUrl: `${process.env.HOST}/callback`,
  sessionSecret: process.env.SESSION_SECRET,
  sessionPath: '/app/data/.session',
  originUrl: process.env.CLOUDRON_APP_ORIGIN,
  secure: true,
  successRedirect: '/dashboard',
  postLogoutUrl: '/',
});

app.get('/dashboard', requireAuth, (req, res) => {
  res.render('dashboard', { user: req.session.user });
});

app.listen(3000);

Behind a reverse proxy (Cloudron, nginx, etc.) add app.set('trust proxy', 1) before setupAuth. Without it Express reports http as the protocol and the callback URL built during the code exchange is wrong.

sessionPath must point at a persistent, writable directory — under Cloudron use /app/data/, which survives restarts and is included in backups.

Configuration

| Field | Required | Description | |---|---|---| | issuerUrl | Yes | OIDC provider issuer URL (e.g. https://rauthy.example.com) | | clientId | Yes | Client ID registered with the OIDC provider | | clientSecret | Yes | Client secret registered with the OIDC provider | | callbackUrl | Yes | Redirect URI registered with the provider | | sessionSecret | Yes | Secret used to sign session cookies | | sessionPath | No | Where to persist session files. Default: ./sessions | | sessionTtl | No | Session lifetime in seconds. The cookie and the stored session both use it, and it is a sliding window. Default: 2592000 (30 days) | | originUrl | No | Absolute origin of this app (e.g. CLOUDRON_APP_ORIGIN). Required to resolve a relative postLogoutUrl | | scopes | No | OIDC scopes to request. Default: openid profile email | | secure | No | Set true to enable Secure cookies (requires HTTPS). Default: false | | loginPath | No | Route that triggers login. Default: /login | | callbackPath | No | Route the provider redirects to. Default: /callback | | logoutPath | No | Route that triggers logout. Default: /logout | | postLogoutUrl | No | Where the IdP sends the user after logout. Must be absolute, or relative to originUrl | | successRedirect | No | Where to send the user after successful login. Default: / |

How It Works

  1. User visits a protected route without a session
  2. requireAuth redirects to /login
  3. authglue generates PKCE verifier + state, redirects to the OIDC provider
  4. User authenticates at the provider (password, passkey, 2FA — whatever the provider supports)
  5. Provider redirects back to /callback
  6. authglue exchanges the authorization code for tokens, creates an Express session
  7. User is redirected to successRedirect with req.session.user populated

Provider-Agnostic

Works with any OIDC-compatible provider:

  • Rauthy
  • Autentico
  • Pocket ID
  • Keycloak
  • Zitadel
  • Auth0
  • Okta
  • Google
  • Any other OIDC provider

Switching providers means changing issuerUrl, clientId, and clientSecret. Nothing else.

What This Package Does Not Do

  • Does not store users or passwords — that's the IdP's job
  • Does not provide an admin UI or login page — the IdP renders those
  • Does not implement OIDC protocol details — openid-client does that
  • Does not handle 2FA or passkeys — the IdP handles those

This package is the glue between your Express app and your OIDC provider. Nothing more.

License

MIT No responsibility, liability ro warranty. Use at your risk.