How haytham-labs/auth works
This is an Express OAuth 2.0 / OpenID Connect server. A client starts an authorization-code request; users sign in or register, approve requested scopes, and the client exchanges the code using PKCE. The server also provides discovery, JWKS, revocation, and logout endpoints through oidc-provider. The excerpts show server routing and persistence calls; protocol endpoint behavior is documented in the README, while several provider details are delegated to the dependency.
Main entry points: server.js Express and OIDC provider · database.js User account operations · mysql-adapter.js OIDC model adapter · security.js CSRF and client config
Components 8
Authorization server
- Express and OIDC provider
src/server.js - Sign-in and consent
src/server.js - Signing keys
User identity
- CSRF and client config
src/security.js - User account operations
src/database.js
Persistence
- OIDC model adapter
src/mysql-adapter.js - MySQL database
db/schema.sql
Other components
- OIDC client
Connections 10
- OIDC client → Express and OIDC provider: requests authorization
README.md - Express and OIDC provider → Sign-in and consent: routes interactions
src/server.js - Sign-in and consent → CSRF and client config: validates input
src/server.js - Sign-in and consent → User account operations: reads and creates accounts
src/server.js - Express and OIDC provider → CSRF and client config: loads client config
src/server.js - Express and OIDC provider → OIDC model adapter: configures adapter
src/server.js - OIDC model adapter → MySQL database: reads and writes models
src/mysql-adapter.js - User account operations → MySQL database: reads and writes users
src/database.js - Express and OIDC provider → Signing keys: loads JWKS
README.md - Express and OIDC provider → OIDC client: serves tokens and protocol endpoints
README.md