TrieOH
IdentityX

Overview

Identity and authentication for the TrieOH platform — actors, projects, organizations, API keys, JWTs.

IdentityX is the platform's identity/tenant service. Every other backend (Univents, Payssage, Informd) bootstraps its own project here and authenticates with a service API key owned by a svc actor.

What it does

  • Actors — humans, services, and machines; everything that can authenticate.
  • Organizations & Projects — multi-tenant scoping; projects are workspaces under an organization.
  • Auth — register/login, Ed25519-signed JWTs, refresh/rotate/logout, JWKS at /.well-known/jwks.json.
  • API keys — server-to-server credentials ({brand}_v1_{env}_{random}); the raw key is returned once at creation.
  • OAuth providers — Google/GitHub login flows per project.
  • Profiles & profile schemas — versioned public identity shapes per project/platform.

Call it

EnvironmentBase URL
Localhttp://localhost:8080
Prodhttps://api.trieoh.com/identityx (or https://api.identityx.com.br)

Authentication

Register or login a user, then send the token as a Bearer header:

curl -s -X POST "http://localhost:8080/auth/login?project_id=$PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"email":"dev@trieoh.com","password":"..."}' | jq .data.access_token

Two credential kinds are accepted everywhere:

SchemeHeaderNotes
Bearer JWTAuthorization: Bearer <token>Ed25519-signed; carries subject.id
API keyX-API-Key: <key>Server-to-server; resolve with GET /auth/introspect

Key concepts

ConceptMeaning
Actorhuman / service / machine identity
Project useractor scoped to a project (no role row)
Project memberactor with a project_members role (owner / admin / member)
Organizationtop-level tenant; projects can be org-scoped
API keybound to a subject actor; hash stored, raw returned once

Endpoint groups

Browse each group in the sidebar:

GroupCovers
authnsetup, register, login, refresh, logout, introspect, JWKS, email verification
projects / organizationstenant and workspace management
actorsproject users and svc accounts
apikeyscreate/list/revoke service API keys
capabilitiescapability registry; keys can be scoped to capabilities
oauthprovidersconfigure Google/GitHub and run the connect/callback flow
profiles / profile_schemaspublic identity and its JSON schema
systemhealth, spec

Bootstrap a fresh environment

Do this in order — the first account is the platform super admin:

# 1. First account (succeeds once)
curl -s -X POST /auth/setup -d '{"email":"admin@trieoh.com","password":"Admin123#"}'   # → $ADMIN_JWT

# 2. One project per service
curl -s -X POST /projects -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{"name":"Univents","brand_slug":"univents","domain":"https://univents.com.br"}'   # → $PROJECT_ID

# 3. A svc account actor in that project
curl -s -X POST /projects/$PROJECT_ID/actors -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{"auth_method":"api_key","type":"service","email":"univents-svc@trieoh.com"}'     # → $SVC_ACTOR_ID

# 4. The service API key ON that actor (caller must be a project admin)
curl -s -X POST /projects/$PROJECT_ID/api_keys -H "Authorization: Bearer $ADMIN_JWT" \
  -d '{"subject_id":"$SVC_ACTOR_ID","name":"univents-svc-key","env":"production"}'       # → data.raw_key (once!)

Gotchas

  • Always read data from the response envelope — a zeroed identity (owner_id 00000000-…) is the classic symptom of reading the envelope root.
  • The API-key route is /projects/{id}/api_keys (underscore) — /api-keys 404s.
  • Svc actors are project users, not members — don't GetMember on them.
  • POST /auth/setup must run before other services boot; they panic "please setup IDX first" otherwise.
  • Dropping the IdentityX DB invalidates every API key and project id — recreate and re-point envs.

On this page