OAuth guides

Use dummyoauth with Passport.js

Point Passport.js at a dummyoauth mock issuer for local OAuth and OIDC development. Dashboard Integration env vars, redirect URI, and production swap steps.

8 min read

Passport.js expects an OAuth/OIDC issuer, client credentials, and a registered redirect URI. dummyoauth is a mock IdP for development and test. The example uses Express with the same PKCE authorization code flow Passport OIDC strategies implement.

Dashboard setup

  1. Sign in and create a project in the dashboard.
  2. Add the generic OIDC provider preset.
  3. Register redirect URI http://localhost:3007/auth/callback on your OAuth client.
  4. Add dummy users for consent screens.
  5. Copy env vars from the Integration panel.

Environment and config

Replace placeholders with values from Integration:

EXAMPLE_APP_ORIGIN=http://localhost:3007
SESSION_SECRET=replace-with-random-string
OAUTH_ISSUER=https://dummyoauth.com/p/your-project
OAUTH_CLIENT_ID=<client-id>
OAUTH_CLIENT_SECRET=<client-secret>

Run the example repo

Clone dummyOAuth/example/passport (port 3007). In the main dummyoauth monorepo you can also run:

pnpm dev:example:passport

All framework integrations.

Production swap

Update issuer and client credentials to your production IdP. Keep variable names stable. Do not use dummyoauth for real user authentication.