Zitadel Setup

ShiftIt uses Zitadel as its OIDC identity provider. Each ShiftIt tenant maps 1:1 to a Zitadel organisation.

First-time setup

  1. Boot Zitadel (Docker Compose includes it; for binary deploys, install separately and point ShiftIt at it).

  2. Create the ShiftIt application in your Zitadel admin console:

    • Project: ShiftIt

    • Application type: User Agent (PKCE)

    • Redirect URIs: https://app.yourdomain.com/auth/callback

    • Post-logout redirect URIs: https://app.yourdomain.com/

  3. Copy the client_id into the frontend build env as ZITADEL_CLIENT_ID and the issuer URL as ZITADEL_AUTH_URL.

Per-tenant onboarding

Each customer organisation needs:

  1. A new Zitadel Organisation created via the admin API.

  2. The organisation’s org_id recorded — this is the zitadel_org_id column in ShiftIt’s tenants table. Insert a row in tenants with this id at onboarding time.

  3. A Zitadel action that adds the shiftit_role claim to issued tokens. The role string ("admin" / "employee" / "customer") is read by ShiftIt’s auth middleware.

Custom claim mapping

ShiftIt expects two custom JWT claims:

  • urn:zitadel:iam:org:id — Zitadel adds this automatically for org-scoped tokens.

  • shiftit_role — added via a Zitadel action. Example action script:

function setShiftItRole(ctx, api) {
    const userMetadata = ctx.v1.user.metadata || {};
    const role = userMetadata.shiftit_role?.value || "employee";
    api.v1.claims.setClaim("shiftit_role", role);
}

Set per-user metadata shiftit_role to "admin" for admins; default is "employee".

See Also

  • ShiftIt design doc — docs/superpowers/specs/2026-05-08-shiftit-design.md (repo, not published)

  • Docker Compose deployment