Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 1.69 KB

readme.md

File metadata and controls

94 lines (68 loc) · 1.69 KB

A Auth0 (micro) copy

Requirements

  • Node 18/20
  • Docker

Install

Clone repo, cd to it:

Env

Add env files:

OP ENV (fastify server)
cat <<EOT > services/idp/.env
# IDP Environment Variables
ISSUER=http://localhost:9876/oidc
POSTGRES_PRISMA_URL='postgres://postgres:secret123@localhost:5432/idp'
POSTGRES_URL_NON_POOLING='postgres://postgres:secret123@localhost:5432/idp'
GRANTS_DEBUG=1
DEBUG=oidc:events:*
DASHBOARD_ORIGIN=http://localhost:3036

# after running scripts/init
DASHBOARD_CLIENT_ID=
EOT
Manage ENV (React SPA)
cat <<EOT > services/manage/.env
# React App Environment Variables
PORT=3036
REACT_APP_ISSUER=http://localhost:9876/oidc

# after running scripts/init
DASHBOARD_CLIENT_ID=
EOT

Run installation for services/idp

Daemonize postgres and jaeger on docker

cd services/idp && docker compose up -d

Install deps: it will run client generation and db migrations as well

npm i

Initialize

Makes those default/readonly objects for bootstrapping:

  • Management API ResourceServer
  • Dashboard OidcClient
  • Default Admin Connection
  • Enables Dashboard OidcClient with a Admin Connection
npm run init

After initialization, output will give a client id that needs to be added to env vars

Script that needs user interaction and let's you create account. (TODO, ask for claims other than email/password)

npm run create-account
npm start

Visit well known url: http://localhost:9876/oidc/.well-known/openid-configuration Visit jwks: http://localhost:9876/oidc/jwks

Run installation for services/manage

cd ../manage && npm i
npm start

Visit management app: http://localhost:3036/