GithubHelp home page GithubHelp logo

big-kahuna-burger / f0 Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 2.09 MB

OIDC Protocol Conforming Identity Provider and a Management Dashboard

Home Page: https://f0-manage.vercel.app

License: MIT License

JavaScript 94.14% EJS 2.97% CSS 2.45% HTML 0.44%
idp issuer jwt jwt-authentication oauth2 oidc oidc-client oidc-server

f0's Introduction

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/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.