Customer onboarding — admin runbook
End-to-end procedure for DSC operators to onboard a new customer onto the Zitadel IAM. Phase 1 scope (where this runbook applies):
- Microsoft Entra ID — fully automated. Customer self-registers their IdP via the wizard; hook auto-assigns project roles based on Entra group membership.
- Okta — login always; automatic role assignment only if the customer supplies a group-read credential in the wizard (optional). Without one it behaves like Google: login works, roles are manual. See §4.1 for the Okta-specific bits and §7 for its failure modes.
- Google Workspace — login only. Customer self-registers OAuth client; a DSC operator (you) assigns project roles manually in Console per user, since Google OIDC doesn't expose group claims.
Still not shipped: self-service secret rotation, Google group sync, and customer-editable group→role mappings — operator-driven workarounds noted inline.
How to use this runbook
A routine onboarding is browser-only. Two Console steps, then one page in the admin UI:
| # | Step | Where |
|---|---|---|
| 1 | Create the customer's org | Zitadel Console |
| 2 | Grant them a project + roles | Zitadel Console |
| 3 | Issue the onboarding link | Admin UI — https://onboard.datasciencescorporation.co.za/onboard-admin |
| 4 | Customer runs the wizard | Their browser, your link |
| 5 | Assign their admin contacts | Zitadel Console |
Every command-line block below is a backup path, kept for when the admin UI or Vault is unavailable, and for the things that genuinely have no UI yet: secret rotation (§6.3, §6.4) and log-watching (§7). Where both exist, the web route is listed first and the CLI is marked as the fallback. You do not need a shell for steps 1–5.
0. Prerequisites
| Need | Where to find it |
|---|---|
Instance IAM_OWNER on Zitadel |
Required for the admin UI (§3). Console → Settings → Administrators |
| A browser — no SSH needed for the normal path | Admin UI at https://onboard.datasciencescorporation.co.za/onboard-admin |
Shell on Site A (10.60.12.31) or Site B (10.60.21.31) |
SSH as root. Only needed for the CLI fallback (§3.2) and log-watching (§7) |
The customer's verified email domain (e.g. oscorp.com) |
Confirm with customer before issuing the ticket — used for domain-discovery routing on auth.…/ui/v2/login |
| Confirmed list of projects + roles to grant them | Lives in DSC org's Console under each project's Project Grants tab |
| Decision on Entra vs Google with the customer | Drives which wizard branch they hit |
The normal path is entirely browser-based. Steps 1 and 2 happen in Zitadel Console, step 3 in the admin UI. You only need a shell for the CLI fallback (§3.2), secret rotation (§6.3, §6.4) and log-watching (§7) — none of which are part of a routine onboarding.
Before you start, open the admin UI and confirm you can sign in:
https://onboard.datasciencescorporation.co.za/onboard-admin
If you get "Access denied" there, you do not hold IAM_OWNER — ask
another administrator to add you (§3.1) before going further, since
every remaining step depends on it.
1. Create the customer's org in Zitadel
Console: sign in as IAM_OWNER at
https://auth.datasciencescorporation.co.za/ui/console/.
- Top-left org switcher → New Organization.
- Name = company name (e.g.
OSCorp). - Skip the "Add user" step — customers self-register via Entra/Google on first login.
- Add the customer's domain as a verified org domain. Org →
Settings → Domains →
oscorp.com→ Skip-verify (you're IAM_OWNER, no DNS step). This is what makes domain discovery on the public login page resolve to their org when their users type an email.
Capture the org id (Org → Settings → Overview → 18-digit ID). You'll need it for step 2.
2. Grant the customer access to one or more projects
In Console, switch back to the DSC org (project owner). For each project the customer should access:
- Projects →
<project name>→ Grants tab → + New Project Grant. - Granted organization = customer org from step 1.
- Tick the roles you want their users to have access to (the full role catalogue — they pick which Entra group gets which role during the wizard's Step 3).
- Save.
Verification is automatic. The admin UI refuses to issue a link for an org with no Project Grant, and tells you so — the same pre-flight the CLI does. So if step 3 succeeds, the grant exists.
If you want to confirm before getting that far, the Console's Grants tab on the project is the direct answer.
CLI equivalent (backup)
If there are no grants, the customer's wizard Step 3 will be empty and the onboarding is meaningless — go back and add grants.
3. Generate the onboarding ticket
3.1 Admin UI (normal path)
https://onboard.datasciencescorporation.co.za/onboard-admin
Sign in with your normal Zitadel account. Access requires instance
IAM_OWNER; anyone else gets a 403 page explaining why. Your
membership is re-checked against Zitadel on every request, so if
yours is revoked mid-session you lose access on the next click rather
than at the next sign-in.
Fill in three things — the same inputs the CLI takes:
- Customer organisation — pick from the list. It shows the org id alongside the name so you can confirm you have the right one.
- Customer email domain — e.g.
oscorp.com. This is what domain discovery matches at the login page, so it must be their real mail domain, not a vanity or redirect domain. It is prefilled from the org's primary domain where that looks like a real domain, and left blank when the org only has the generated<org>.auth.datasciencescorporation.co.zaone. - Link lifetime — hours, default from
TICKET_TTL_HOURS, capped at 168 (one week). The link is a one-shot capability to write an IdP secret; shorter is better.
Press Create link, then Copy link. The same page lists every ticket with its status, who issued it, and a Revoke button.
Tickets issued here are attributed to your Zitadel login, not to the shell user — which is the point of putting it behind a sign-in.
If the org has no Project Grant the UI refuses to issue, with the same pre-flight the CLI does. That is deliberate: without a grant the customer reaches Step 3 with nothing to map and wastes a link.
If someone without IAM_OWNER opens it
They are sent to the normal Zitadel login first, authenticate successfully, and then get a 403 page. So the report you will hear is "I logged in fine but it says access denied" — that is the gate working, not a broken login.
Access denied
Your account is signed in but does not have the role required to use this page.
Signed in as
their.name@datasciences.co.za.This page is restricted to platform administrators. If you believe you should have access, contact a platform administrator to request it.
Sign out and try a different account.
The page deliberately does not name the role. Telling an unauthorised visitor exactly which role to acquire is free reconnaissance, so the user-facing copy stays vague and the specifics go to the log instead:
To grant access: Console → Settings → Administrators → add the user
with IAM_OWNER. It takes effect on their next click — the membership
is re-checked on every request, so they do not need to sign out and in.
A near-identical page appears when the check could not run at all, rather than when it failed:
Your access could not be verified right now. Try again shortly.
That is the fail-closed path — an unreachable or erroring Zitadel denies access rather than granting it. The two look similar on purpose; the log tells them apart:
Check Zitadel and the proxy logs (§7) if it persists.
3.2 CLI fallback
Still works, and is the path to use if the admin UI or Vault is unavailable. Interactive wrapper does the env-var plumbing:
Prompts walk through:
- Select org [1-N] — pick the customer's org from the numbered list.
- Customer email domain — e.g.
oscorp.com. Must match the verified org domain you added in step 1. - Ticket TTL — default 72h. Press enter unless customer needs more lead time.
- Mint ticket? — type
yto confirm.
Output ends with:
Send the URL to the customer admin via a private channel. Either:
- Direct email from your
@datasciences.co.zaaccount (preferred — reaches their existing inbox without them having to sign up for anything), or - Teams DM, or
- Password-manager share (1Password / Bitwarden / etc.) — useful if the customer is unusually security-sensitive
Platform-side SMTP also delivers reliably now (Zitadel's notification
mails go out from auth@datasciencescorporation.co.za via the internal
M365 relay — verified delivering to Google + M365 inboxes). The wizard
itself doesn't email the URL; that's still operator-driven.
Don't paste the URL into a ticketing system that everyone in your org can see — it's effectively a one-shot capability for IdP-secret write during the TTL.
Reminder text to include with the URL:
The link is single-use and expires on
<date from CLI output>. Open it in a browser, follow the three-step wizard. You'll need the values from your Entra Admin Center or Google Cloud Console (the wizard's "Setup checklist" sections walk you through what to create). Reply when done and we'll finish setup.
4. Customer runs the wizard
They click the URL → 3-step wizard:
| Step | What they do |
|---|---|
| 1 | Pick IdP — Entra, Okta or Google. |
| 2 | Follow the embedded setup checklist in their IdP portal, then paste the credentials: tenant_id (Entra), issuer URL (Okta), client_id and client_secret (all). Okta additionally offers an optional group-read credential — see §4.1. |
| 3 | Entra, and Okta with a group-read credential — type their IdP group name, tick which project roles members of that group should hold. Add more group cards as needed. Google, and Okta without a group-read credential — informational only (manual role assignment, see §5). |
They click Register IdP. If successful, they see a green card
with the login URL. From now on oscorp.com users typing their email
at auth.datasciencescorporation.co.za/ui/v2/login get an "Sign in
with Microsoft / Google" button.
If the wizard errors out (Entra rejected creds, domain collision,
etc.), the ticket is not consumed — they can retry up to the TTL.
You can confirm state via the admin UI's ticket table, or
auth-onboard list --all.
4.1 Okta specifics
Tell the customer these four things when you send the link. They are the ones that actually go wrong.
- Assign users to the Okta app. In Okta, an OIDC app has its own assignment list. A user who is not assigned cannot sign in at all, and the error appears on Okta's side, not ours — so it looks to them like our problem. This is the single most common stumble.
- The issuer must match their discovery document exactly. Their
issuer is either
https://<org>.okta.com(most orgs, or their custom domain) orhttps://<org>.okta.com/oauth2/<id>if they use a custom authorization server. The wizard's checklist tells them to open<issuer>/.well-known/openid-configurationand check theissuervalue character for character. A near-miss here fails after an apparently successful Okta login, which is hard to diagnose. - Group-read credential is optional, and there are two ways.
Option A is an Okta API service app with the
okta.groups.readscope and client-secret authentication — preferred, because the tokens are short-lived and scoped to reading groups. Option B is an SSWS API token — one field, but it expires 30 days after its last use, that period cannot be changed, and it carries the full rights of whoever created it. Tell them to create it as a read-only admin, not a Super Admin. Leaving both blank is fine: Okta then behaves like Google. - Group names are matched character for character. Capitals, spaces and punctuation all count, and we match the Okta group's name. A typo grants no roles and produces no error anywhere the customer can see.
Known gap: if the customer's Okta service app requires
private-key (JWT) authentication rather than a client secret, Option
A will not work yet — they should use Option B until that lands. See
media/okta-idp-integration.md §11.1.
5. Post-onboarding admin tasks (you, in Console)
The wizard intentionally does NOT assign any admin role to the first-onboarded user. You do that manually so a customer can't self-elevate.
Design rule: customer admins must ONLY be able to manage role assignments on their users for the granted projects. They must NOT be able to change IdP config, org settings, project grants, or any other state. ORG_OWNER is too broad and is never assigned to a customer.
For each customer pick 1–2 trusted ops contacts and give them BOTH of the following:
5.1 ORG_USER_PERMISSION_EDITOR — assigns user → project roles
This is the only role they need for day-to-day role management. Lets them add/remove user authorizations (i.e. project-role assignments) on users in their own org. Nothing else.
Applies to Entra customers (when they want to manually override or add roles outside what their groups dictate) AND Google customers (the only path to role assignment for Google users, since there's no group claim).
- Wait for the user to have logged in at least once (user record is created on first login).
- Console → switch into the customer's org via the org switcher.
- Users →
<the customer's ops contact>→ Memberships → + Add. - Role = ORG_USER_PERMISSION_EDITOR.
5.2 ORG_OWNER_VIEWER — read-only visibility + Phase 2 rotation gate
Assign to the SAME 1–2 ops contacts. Gives: - Read access to org state (users, settings, IdP — view only) - The gate for the IdP secret-rotation flow when it ships (Phase 2 — see §6.3)
Until Phase 2 ships, the rotation gate part is a no-op, but pre-assigning means you won't have to chase customers later.
Console → customer org → Users → <same ops contact as above> →
Memberships → + Add → Role = ORG_OWNER_VIEWER.
5.3 Manual per-user role assignment (Google + Entra overrides)
For Google customers this is the only path. For Entra customers it's how the ops contact patches up edge cases (user not in the right group, group→role mapping missed something, temporary access).
The ops contact (now holding ORG_USER_PERMISSION_EDITOR) does:
- Console → customer org → Users →
<user>→ Authorizations → + Add. - Project = the granted project.
- Roles = the right project roles for that user.
They cannot touch project grants, IdP config, or org settings — the role is scoped to user authorizations only.
6. Ongoing operations
6.1 Listing tickets
The admin UI's ticket table (§3.1) shows all of this in a browser — organisation, domain, status, expiry and who issued it — and is the normal way to look. The CLI remains for scripting and for when the UI is unavailable:
/root/auth/auth-onboard list # only active (unconsumed, unexpired) tickets
/root/auth/auth-onboard list --all # includes consumed, revoked, expired
/root/auth/auth-onboard show <uuid> # full detail for one ticket
6.2 Revoking a ticket before it's consumed
If you mis-issued, or the customer doesn't get back to you and you want to invalidate the link:
Admin UI: press Revoke on the ticket's row and confirm.
CLI:
You'll be shown the ticket state, prompted for a reason, asked to confirm. URL becomes 410 Gone immediately.
6.3 Customer Entra client secret expired
Phase 2 plan: customer admin (with ORG_OWNER_VIEWER) clicks a rotate-link from email, types new secret in a wizard. Wizard not yet built. Email delivery infra IS ready (resolved 2026-06-12) so Phase 2 only needs the wizard code, not new mail plumbing.
Phase 1 workaround until the wizard ships:
- Issue a fresh onboarding ticket (step 3 above).
- Customer runs the wizard again with the new client secret.
- Wizard's dual-write logic updates the IdP record + Vault credential atomically (in-place — same idp_id, no user-link churn).
6.4 DSC's own Entra secret rotation
Different from a customer rotation — this is the IdP DSC operators log in through. Use the dedicated tool:
Prompts silently for tenant_id, client_id, new client_secret. Updates Zitadel + Vault atomically. Old Entra-portal secret stays live in parallel until you delete it — useful safety net during the cutover.
6.5 Adding a new project to an already-onboarded customer
All in Console — no shell, and no need to re-issue an onboarding link.
- Console → DSC org → that project → Grants → +New Project Grant → pick customer org → tick roles.
- Console → customer org → Settings → Metadata → add an entry keyed
by their IdP group name, value
<projectId>/<role>[,<projectId>/<role>...](comma-separated). - Members of that group get the new roles on the next login.
Mind the separator. Entries are comma-separated with no spaces. A
stray space makes the parser read two entries as one, the role key
picks up the next entry's project id, and Zitadel rejects the whole
authorization with Errors.Project.Role.NotFound — the hook logs it
and moves on, so the user simply ends up with no role. This has bitten
before (2026-06-29).
(Skip step 2 for Google, and for Okta customers who did not supply a group-read credential — assign roles manually per §5.3 instead.)
6.6 Removing a customer
- Console → DSC org → revoke their project grants (Project → Grants → row → Delete).
- Console → customer org → archive or delete.
- Their IdP record + Vault credential + group→role metadata vanish along with the org. No additional Vault cleanup needed.
7. Troubleshooting
Symptom: customer's user gets in but has no project roles
Hook log will tell you why. Tail both sites; CF tunnel can land on either:
docker logs -f auth-a-idp-hook | grep -E "user=|req-trigger|authz"
ssh root@10.60.21.31 'docker logs -f auth-b-idp-hook | grep -E "user=|req-trigger|authz"'
Look for the customer's login event. Likely patterns:
| Log fragment | Cause |
|---|---|
no idp creds available |
Vault entry missing for the customer's idp_id. Check secret/data/idp/<idpId>/credentials exists. |
groups=0 |
User isn't in any Entra group whose name matches an org-metadata key. Confirm the customer's wizard Step 3 group names match what's actually in their tenant. |
groups=N authz +0 ~0 -0 |
Groups fetched but nothing matches the metadata mapping. Mis-typed group name. |
groups=N authz +K … |
Working — K grants added. |
Symptom: ticket URL returns 410 Gone
Ticket is consumed, revoked, or expired. The admin UI's ticket table
shows which in the Status column — Used, Revoked or Expired.
(auth-onboard show <uuid> gives the same answer from a shell.)
If it shows Used but the customer never reached the success page, the dual-write may have partially failed — check the proxy log:
docker logs auth-a-onboard-proxy --since 1h | grep ticket=<uuid>
ssh root@10.60.21.31 'docker logs auth-b-onboard-proxy --since 1h | grep ticket=<uuid>'
Look for rollback lines. If the IdP did get created in Zitadel
despite the rollback (rare race), manually delete it via Console
before re-issuing a fresh ticket.
Symptom: issuing a link fails with "no project grants"
Step 2 wasn't done. Both the admin UI and the CLI refuse rather than mint a link that would land the customer on an empty Step 3. Add the project grants in Console, then issue again.
The UI's wording is: "That organisation has no Project Grants, so the wizard's Step 3 would be empty. Create the grant in Console first, then issue the link."
Symptom (Okta): customer can't sign in at all
Order of likelihood:
- User not assigned to the Okta app. Ask them to check Applications → their app → Assignments. This is the usual cause and the error shows in Okta, not here.
- Issuer mismatch. Have them open
<issuer>/.well-known/openid-configurationand compare theissuervalue to what they entered. A mismatch fails after an apparently successful Okta login. - Email unverified. Should not happen — the hook marks the email
verified on successful Okta login — but confirm:
PAT=$(cat /root/auth/site-a/data/zitadel/admin.pat) curl -sS -H "Authorization: Bearer $PAT" \ https://auth.datasciencescorporation.co.za/v2/users/<userId> \ | jq '.user.human.email'isVerified: falseplus a refusal at the session step means the verification did not land in time. Look forokta: marked email verifiedin the hook log.
Symptom (Okta): login works but no roles
Watch Site A's hook — all hook traffic goes there regardless of which site served the session:
| Log line | Meaning |
|---|---|
no usable group-read credential |
They left both Okta group-read options blank. Login-only by design — assign roles manually (§5.3) or re-onboard with a credential. |
okta groups: HTTP 403 |
Scope not granted, or the token lacks permission. |
okta groups: rate limited (429) |
Okta org rate limit. Rare for one user; retry. |
private_key_jwt auth not implemented |
Their service app uses private-key auth. Switch them to an SSWS API token (§4.1 Option B). |
metadata keys NOT matched |
Group-name typo. The listed names are what Okta actually returned — compare against what they typed in Step 3. |
Symptom: Detected site: unknown from the wrapper
Only affects the CLI fallback. You are not on a site host — SSH to
root@10.60.12.31 or root@10.60.21.31 and try again. The admin UI
(§3.1) has no such requirement.
Symptom: admin UI says "Access denied" after a successful sign-in
Expected when the account lacks the required role — see §3.1. If the account should have it, check the proxy log:
not an instance IAM_OWNER means the membership genuinely is not
there. IAM_OWNER check failed means Zitadel could not be reached, and
the page fails closed rather than letting them in.
8. Quick reference
Web (normal path)
| Task | Where |
|---|---|
| Create customer org | Console → Organizations |
| Create Project Grant | Console → project → Grants |
| Issue an onboarding link | Admin UI — https://onboard.datasciencescorporation.co.za/onboard-admin |
| List / copy / revoke links | Admin UI, same page |
| Assign customer admin roles | Console → customer org → Members |
| Assign a user's project roles | Console → customer org → Users → Authorizations |
CLI (backup — when the admin UI or Vault is unavailable)
# Ticket operations behind one wrapper:
/root/auth/auth-onboard help
/root/auth/auth-onboard issue
/root/auth/auth-onboard list [--all]
/root/auth/auth-onboard show <uuid>
/root/auth/auth-onboard revoke <uuid>
# DSC-only — rotate our own Entra IdP secret:
bash /root/auth/tools/auth-entra-rotate
# Cluster health any time:
docker ps --format 'table {{.Names}}\t{{.Status}}' | grep auth-
tools/auth-patroni-db-cluster-state site-a/
tools/auth-etcd-cluster-state site-a/
# Hook activity live:
docker logs -f auth-a-idp-hook
ssh root@10.60.21.31 'docker logs -f auth-b-idp-hook'
9. Role catalogue cheat-sheet
For customer-side users (assigned by you, in their org):
| Role | What it grants | Use for |
|---|---|---|
ORG_USER_PERMISSION_EDITOR |
Add/remove user authorizations (assign project roles to users in this org). Nothing else. | The day-to-day "manage who has access to what" role. Assign to 1–2 ops contacts per customer. Applies to Entra + Google. |
ORG_OWNER_VIEWER |
Read-only org admin (view users, settings, IdP). Gate for Phase 2 self-service secret rotation. | Same 1–2 ops contacts. Adds read visibility + future rotation gate. |
Never assigned to a customer:
| Role | Why not |
|---|---|
IAM_OWNER |
Instance-wide god mode. DSC operators only. |
ORG_OWNER |
Full control of their own org — too broad. Lets them edit IdP, change settings, create projects, etc. |
ORG_SETTINGS_MANAGER |
Can modify org settings (login policy, password policy, etc). |
ORG_USER_MANAGER |
Can create/delete users — risky combined with self-issued IdP control. |
ORG_PROJECT_PERMISSION_EDITOR |
Can re-issue project grants on resources we own. |
Project-level roles (e.g. ocs:iaas:ro, developer):
| Where they come from |
|---|
| Entra customers: auto-assigned by the hook based on Entra group membership + the group→role mapping the customer entered in the wizard's Step 3. Hook reconciles on every login. |
| Google customers: manually by their ORG_USER_PERMISSION_EDITOR, per user, via Console → Users → Authorizations. |
| Either: ORG_USER_PERMISSION_EDITOR can override / add roles ad-hoc for an Entra user too (e.g. temporary access without changing the group). |
Never assigned at the IdP record level.
10. What this runbook intentionally does NOT cover
- Cluster recovery / Vault rebuild — see
media/vault-deployment-runbook.md - IdP-hook internals + race-condition design — see
media/request-trigger-grant-race-fix.md - Login-policy / default-org wiring — see
media/login-policy-runbook.md - Email deliverability fixes — see
media/email-deliverability-planning.md - Okta design, open questions and implementation detail — see
media/okta-idp-integration.md - Remaining Phase 2 features (Google group sync, self-service secret
rotation) — see
media/customer-self-onboard-planning.md§5 and §8 - Letting customers edit their own group→role mappings (not built) —
see
media/customer-self-service-mapping-portal.md