Identity Architecture

All Coderaft products share a single OIDC identity provider for operator authentication. The configuration is stored exactly once — in Coderaft Vault — and consumed at boot by each product container.

Two distinct OIDC contexts

Context What it is Where configured
Platform OIDC Operator login to the Coderaft dashboard Coderaft Vault — platform/identity/oidc
WolfGuard Graph App Coderaft scanning a client's Entra ID tenant WolfGuard Setup Wizard (azure_tenant_id, azure_client_id)
These are separate contexts. Platform OIDC = the identity of the operator (administrator → dashboard). Graph App credentials = the identity of the scanner (Coderaft product → client tenant).

Setup flow

Setup Wizard → step: setup-identity

→ POST /api/dashboard/identity/configure

→ dashboard-api → vault-client-platform.js

→ PUT /v1/platform/identity/oidc (mTLS)

→ Coderaft Vault (AES-256-GCM + age-wrapped DEK)

Boot priority chain

Each product reads the OIDC config at startup using this priority chain:

1

Environment variables

REDFOX_OIDC_ISSUER / PLATFORM_OIDC_ISSUER — Fastest — no network call

2

Coderaft Vault

GET /v1/platform/identity/oidc (mTLS) — Source of truth

3

setup_config DB

Legacy wizard data (backward compat) — Fallback only

4

SetupMode

Products start degraded — no sessions — All previous failed

Secret schema

Secret name: platform/identity/oidc — stored as AES-256-GCM encrypted JSON:

Vault secret — platform/identity/oidc
{
  "issuer":        "https://login.microsoftonline.com/{tenant}/v2.0",
  "client_id":     "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "client_secret": "…",
  "redirect_url":  "https://coderaft.example.com/api/dashboard/auth/callback"
}
Security: client_secret is never returned by the GET endpoint. Only the PUT endpoint (dashboard-api → Vault) accepts it.

mTLS certificates per product

Container Cert SAN ACL
dashboard-apidashboard-api.coderaft.localFull admin
redfox-apiredfox.coderaft.localread:platform/identity/oidc, read:redfox_*
entraguard-apientraguard.coderaft.localread:platform/identity/oidc, read:entraguard_*
ravenscanravenscan.coderaft.localread:platform/identity/oidc, read:ravenscan_*

Certs are generated by the vault-init-certs container on first docker compose up. Lifetime: 90 days. Rotation: re-run vault-init-certs, then restart products.

Dashboard API endpoints

Method Path Description
POST/api/dashboard/identity/configureWrite OIDC config to Vault (setup or admin)
GET/api/dashboard/identity/statusCheck if configured (no secret returned)
POST/api/dashboard/identity/testTest OIDC discovery endpoint reachability

Reconfiguring OIDC on existing setups

Navigate to Settings → Platform → Identity (OIDC) in the dashboard. The current issuer and client_id are pre-populated. The client_secret must always be re-entered to save changes (the Vault GET endpoint never returns it).

Role Capability
Any authenticated userView current issuer / client_id (read-only)
global_adminEdit and save configuration

Next steps