2024-09-29 14:02:10 +02:00
# @idp.global/idp.global
2026-05-07 15:35:37 +00:00
Identity infrastructure for apps that need accounts, sessions, organizations, invites, admin tooling, mobile passport approvals, security alerts, and OpenID Connect in one TypeScript codebase.
2024-09-29 14:02:10 +02:00
2026-05-18 16:00:28 +00:00
This repository ships the `idp.global` server, CLI, web UI, and tspublish submodules used by the hosted service. Shared public contracts live in `@idp.global/interfaces` ; reusable browser/server SDK code lives in `@idp.global/sdk` .
2024-09-29 14:02:10 +02:00
2025-12-16 12:46:42 +00:00
## Issue Reporting and Security
2024-09-29 14:02:10 +02:00
2025-12-16 12:46:42 +00:00
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/ ](https://community.foss.global/ ). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/ ](https://code.foss.global/ ) account to submit Pull Requests directly.
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
## What It Does
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
- Runs an identity provider with MongoDB-backed users, sessions, roles, organizations, invitations, API tokens, and billing plans.
- Serves a web app for login, registration, account management, org management, billing flows, and global admin views.
- Exposes typed realtime APIs over `typedrequest` and `typedsocket` .
- Implements OIDC/OAuth endpoints including discovery, JWKS, authorization, token, userinfo, and revoke.
2026-05-07 15:35:37 +00:00
- Supports passport-style mobile device enrollment, signed approval challenges, push registration, security alerts, and NFC/location-backed identity proof flows.
2026-04-20 08:15:42 +00:00
- Includes a reusable browser client and a terminal CLI for common account and org workflows.
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
## Monorepo Modules
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
| Folder | Purpose |
| --- | --- |
| `ts/` | Backend service entrypoint and the core `Reception` managers |
| `ts_idpcli/` | CLI published as `@idp.global/cli` |
| `ts_web/` | Frontend bundle with login, registration, account, org, billing, and admin views |
2026-05-07 15:35:37 +00:00
| `../interfaces/` | Shared request and data contracts published as `@idp.global/interfaces` |
2026-05-18 16:00:28 +00:00
| `../sdk/` | Browser and server SDK published as `@idp.global/sdk` |
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
## Core Backend Pieces
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
`Reception` wires the service together and starts these managers:
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
- `JwtManager` for signing, refreshing, and validating JWTs.
- `LoginSessionManager` for login state and session lifecycle.
- `RegistrationSessionManager` for multi-step sign-up flows.
- `UserManager` for user lookups and account data.
- `OrganizationManager` for org creation and membership lookup.
- `RoleManager` for org roles and permissions.
- `UserInvitationManager` for invites, membership updates, and ownership transfer.
- `ApiTokenManager` for long-lived token auth.
- `BillingPlanManager` for Paddle-backed billing data.
- `AppManager` and `AppConnectionManager` for app connections and admin app stats.
- `ActivityLogManager` for audit-style activity entries.
2026-05-07 15:35:37 +00:00
- `AlertManager` for passport alerts and organization/global alert rules.
- `AbuseProtectionManager` for rate-limited sensitive flows such as OIDC token exchange.
- `PassportManager` and `PassportPushManager` for trusted device enrollment, challenge approval, and push notification delivery.
2026-04-20 08:15:42 +00:00
- `OidcManager` for the OIDC/OAuth provider surface.
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
## Quick Start
2026-01-29 15:06:40 +00:00
### Prerequisites
- Node.js 20+
2026-04-20 08:15:42 +00:00
- `pnpm`
- MongoDB
2026-01-29 15:06:40 +00:00
2026-04-20 08:15:42 +00:00
### Install
2026-01-29 15:06:40 +00:00
``` bash
pnpm install
```
2026-04-20 08:15:42 +00:00
### Required Environment
2026-01-29 15:06:40 +00:00
``` bash
export MONGODB_URL = mongodb://localhost:27017/idp-dev
export IDP_BASEURL = http://localhost:2999
export INSTANCE_NAME = idp-dev
```
2026-04-20 08:15:42 +00:00
Optional:
2026-01-29 15:06:40 +00:00
2026-05-07 15:35:37 +00:00
- `SERVEZONE_PLATFORM_AUTHORIZATION`
2026-04-20 08:15:42 +00:00
- `PADDLE_TOKEN`
- `PADDLE_PRICE_ID`
2026-01-29 15:06:40 +00:00
2026-04-20 08:15:42 +00:00
### Build
2026-01-29 15:06:40 +00:00
2026-04-20 08:15:42 +00:00
``` bash
pnpm build
```
2026-01-29 15:06:40 +00:00
2026-04-20 08:15:42 +00:00
### Run Locally
2026-01-29 15:06:40 +00:00
2026-04-20 08:15:42 +00:00
``` bash
pnpm watch
```
2026-01-29 15:06:40 +00:00
2026-04-20 08:15:42 +00:00
This starts the backend from `ts/` and rebuilds the frontend bundle from `ts_web/` . The service listens on port `2999` .
2026-01-29 15:06:40 +00:00
2026-05-07 15:35:37 +00:00
### Seed Development Data
``` bash
pnpm run seed
```
The seed command starts an interactive CLI that writes to the configured local database. The default demo workspace creates a global admin, an organization, demo users, and global OAuth app records.
Default development credentials if accepted unchanged:
- Email: `admin@idp.global`
- Password: `idp.global`
2026-04-20 08:15:42 +00:00
## Runtime Surface
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
### Web Routes
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
| Route | Purpose |
| --- | --- |
| `/` | Welcome page |
| `/login` | Login flow |
2026-05-07 15:35:37 +00:00
| `/logout` | Logout flow |
2026-04-20 08:15:42 +00:00
| `/register` | Registration flow |
| `/finishregistration` | Multi-step registration completion |
2026-05-07 15:35:37 +00:00
| `/account` | Signed-in account area and account subroutes |
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
### OIDC and OAuth Endpoints
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
| Route | Purpose |
| --- | --- |
| `/.well-known/openid-configuration` | Discovery document |
| `/.well-known/jwks.json` | Public signing keys |
| `/oauth/authorize` | Authorization endpoint |
| `/oauth/token` | Token exchange |
| `/oauth/userinfo` | UserInfo endpoint |
| `/oauth/revoke` | Token revocation |
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
Supported scopes in the OIDC manager include `openid` , `profile` , `email` , `organizations` , and `roles` .
2025-12-16 12:46:42 +00:00
2026-05-07 15:35:37 +00:00
## Passport And Mobile Approval Flow
`PassportManager` powers the trusted-device side of idp.global. A web session can create a passport enrollment challenge, the Swift app completes enrollment through a QR/NFC pairing payload, and later sign-in or identity checks can be approved by the paired device with signed challenge responses.
The typed request surface includes:
- `createPassportEnrollmentChallenge` and `completePassportEnrollment` for pairing a trusted device.
- `getPassportDevices` and `revokePassportDevice` for account-level device management.
- `createPassportChallenge` , `approvePassportChallenge` , `rejectPassportChallenge` , and `listPendingPassportChallenges` for approval flows.
- `getPassportDashboard` , `listPassportAlerts` , and `markPassportAlertSeen` for mobile app dashboards and notifications.
- `registerPassportPushToken` for push delivery setup.
2026-04-20 08:15:42 +00:00
## SDK Example
2026-05-18 16:00:28 +00:00
Browser integrations should use the dedicated SDK browser entrypoint published by `@idp.global/sdk` .
2026-04-20 08:15:42 +00:00
``` ts
2026-05-18 16:00:28 +00:00
import { IdpClient } from '@idp.global/sdk/browser' ;
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
const idpClient = new IdpClient ( 'https://idp.global' ) ;
2025-12-16 12:46:42 +00:00
await idpClient . enableTypedSocket ( ) ;
2024-09-29 14:02:10 +02:00
2025-12-16 12:46:42 +00:00
const isLoggedIn = await idpClient . determineLoginStatus ( ) ;
2026-04-20 08:15:42 +00:00
if ( ! isLoggedIn ) {
const loginResult = await idpClient . requests . loginWithUserNameAndPassword . fire ( {
username : 'user@example.com' ,
password : 'secret' ,
} ) ;
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
if ( loginResult . refreshToken ) {
await idpClient . refreshJwt ( loginResult . refreshToken ) ;
}
2025-12-16 12:46:42 +00:00
}
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
const whoIs = await idpClient . whoIs ( ) ;
console . log ( whoIs . user . data . email ) ;
2024-09-29 14:02:10 +02:00
```
2026-04-20 08:15:42 +00:00
## CLI Example
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
The terminal client lives in `ts_idpcli/` and is published as `@idp.global/cli` .
2025-12-16 12:46:42 +00:00
``` bash
idp login
idp whoami
idp orgs
idp members --org <org-id>
idp invite --org <org-id> --email user@example.com
2024-09-29 14:02:10 +02:00
```
2026-04-20 08:15:42 +00:00
The CLI stores credentials in `~/.idp-global/credentials.json` and reads `IDP_URL` to override the target server.
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
## Shared Interfaces
2025-12-16 12:46:42 +00:00
2026-05-07 15:35:37 +00:00
The sibling `@idp.global/interfaces` package exports the type contracts shared across the stack:
2025-12-16 12:46:42 +00:00
2026-05-07 15:35:37 +00:00
- `data/*` for users, orgs, roles, JWTs, sessions, devices, billing plans, apps, passport records, alerts, and OIDC payloads.
- `request/*` for auth, registration, user, org, invitation, app, admin, billing, JWT, passport, alert, and OIDC request contracts.
2026-04-20 08:15:42 +00:00
- `tags/*` for shared tag exports.
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
## Frontend
2024-09-29 14:02:10 +02:00
2026-04-20 08:15:42 +00:00
`ts_web/` is the web application bundle. It contains:
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
- Login and registration prompts.
- A registration stepper.
- Account navigation and account views.
- Organization creation and bulk invite modals.
- Billing and Paddle setup views.
- A global admin view.
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
## Package Scripts
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
| Command | Purpose |
| --- | --- |
| `pnpm build` | Build TypeScript output and frontend bundle |
| `pnpm watch` | Run backend watch mode and frontend bundle watch |
| `pnpm test` | Build and run the test suite |
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
## Repository Notes
2025-12-16 12:46:42 +00:00
2026-04-20 08:15:42 +00:00
- Package manager: `pnpm`
- Main backend entrypoint: `ts/index.ts`
- Frontend entrypoint: `ts_web/index.ts`
2026-05-18 16:00:28 +00:00
- Browser SDK entrypoint: `@idp.global/sdk/browser`
2026-04-20 08:15:42 +00:00
- CLI entrypoint: `ts_idpcli/index.ts`
2024-09-29 14:02:10 +02:00
## License and Legal Information
2026-04-20 08:15:42 +00:00
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license ](./license ) file.
2024-09-29 14:02:10 +02:00
**Please note: ** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
2025-12-16 12:46:42 +00:00
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
2024-09-29 14:02:10 +02:00
### Company Information
2026-04-20 08:15:42 +00:00
Task Venture Capital GmbH
2025-12-16 12:46:42 +00:00
Registered at District Court Bremen HRB 35230 HB, Germany
2024-09-29 14:02:10 +02:00
2025-12-16 12:46:42 +00:00
For any legal inquiries or further information, please contact us via email at hello@task .vc.
2024-09-29 14:02:10 +02:00
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.