The scene
The distributor sells and supports the practice software sixty small clinics in the region already run, on a cloud hospital system/laboratory system of its own. Its support desk is the number those clinics call. Its identity directory already holds their staff accounts, because it already administers them.
It now resells Jengu alongside. Rein, its integration engineer, is adding a Jengu leg to an onboarding script that already provisions a clinic in their own products. He has never spoken to anyone at Jengu about this particular clinic and does not intend to.
The clinic is Männi Perearstikeskus: four GPs, two nurses, a receptionist. They want visit recording and lab ordering. Their practice manager, Kadri, will set up the edge box in the back office herself.
What a distributor is
A distributor is a participant in its own right — not a department
of Jengu's administrative organisation and not a member of it. The
platform already asks what kind of participant something is, and
answers with aspects: healthcare-provider, insurer. A distributor
is the third.
That placement is not filing tidiness. Jengu's own admin org is barred from every customer organisation URL space as a GDPR boundary, and a commercial counterparty — with its own contract, its own staff, sometimes its own competing product — has no business inside it. Membership is also the wrong shape for the question that matters: "which customer organisations are yours" is a relation between two participants, and cannot be derived from "you are in our admin org".
As a participant it gets everything the platform already does per
participant: its own configuration repository, keys, users, clients
and audit trail — and its own lifecycle, so a distributor that stops
paying can be suspended like anyone else. It carries no
healthcare-provider aspect, so there is no clinical data in its
project to reach: the ceiling on patient data is structural rather
than a scope check that has to be right.
The distributor's key, and its ceiling
The distributor holds a machine key bound to its own participant. It is not a shared password, not a Jengu employee's account, and not a credential any of its customers can borrow — a token minted for a customer customer organisation cannot reach the surface that governs customer customer organisations, however that client was declared.
The rule the operator surface applies has no special cases in it: the
caller's client is bound to a participant carrying the distributor
aspect, and the target customer organisation's owner is that participant. Jengu's own
direct customers are owned by a participant too, so there is one rule
rather than a rule plus an exception.
What the key can do is bounded on purpose:
- create a customer organisation, naming the customer's first administrator;
- read the status of customer organisations it owns;
- suspend and resume them — the commercial lever, for a clinic that stops paying;
- declare its own authority connectors, and push the people its directory holds.
What it can never do is destroy one. Disposal ends in cryptoshredding, and a channel relationship is not a reason to hold that: a hospital's record has to outlive a billing dispute.
And it cannot enumerate the platform. There is no list of Jengu's customer organisations for a distributor to read — that list is our customer base, and it is not something to hand to a party that may also sell against us. A distributor sees the customers it owns and nothing else; two distributors on one platform are two disjoint views.
Asking after a customer organisation that is not yours answers the same way as asking after one that does not exist. The platform already refuses to leak customer organisation existence — a request that crosses customers answers 404 rather than 403, so nobody can probe for "that exists but you cannot have it" — and the operator surface holds the same line.
Every call lands in two trails, the platform's and the organisation's own, naming the distributor client that made it. A hospital can always see what its distributor did to it.
Step 1 — the customer organisation, and the person who owns it
The create call names the clinic's first administrator: their address, and the subject identifier the distributor's authority will assert for them.
The customer organisation materialises with its own project, organization tree and keys. A local administrator account is created for that person and a temporary credential reaches their mailbox. The path runs platform → person: the distributor supplies the address and never sees the credential, cannot replay it, cannot suppress it.
At this moment nothing is delegated. The clinic's only way in is the account it alone controls — which is precisely why the next step is the clinic's decision rather than the distributor's.
The first administrator is the hospital's
By contract, the first administrator of a customer organisation is a person at the customer, not at the distributor. Afterwards the owner may add the distributor's own account as an administrator — for support, on purpose, and revocably. What the distributor may not do is arrive that way.
The platform cannot prove an address belongs to a hospital, so the rule is enforced the honest way: contractually, and made detectable.
- Creation records the first administrator's address and subject, the distributor client that named them, and when.
- "First" is answered from the append-only trail, not from current state — removing that admin later does not remove the evidence.
- The customer organisation's trail is append-only against an administrator at the customer too. Otherwise a distributor that breached the rule holds exactly the rights needed to tidy up after itself.
- And the hospital sees it unprompted: "Your customer organisation was created by
on . Your first administrator was ."
Comparing the address domain against the clinic's own is a useful flag and not proof — a distributor that runs a clinic's IT can make a mailbox in the clinic's domain. The control is that the fact is permanent, visible to the party harmed, and a named breach of the partnership contract.
Step 2 — the distributor declares its authority once, per environment
The distributor does not configure sixty clinics' logins. It declares its authority connector: a reference to the driver that speaks its protocol, plus the credentials to reach it — once per environment.
Three of those exist for the same reason the order lane has them: development, test and production are separate connectors with separate credentials, and the wall between them is structural. A test authority cannot mint a session in a production customer organisation. Not discouraged — refused at resolution. Identity is the one place where a misconfigured reference is a one-hop path into patient data with no exploit required.
Declaration and secret split the way the platform already splits them elsewhere: the connector's driver reference, issuer and client id are declared config; the secret lives only in the secret store and is resolved at ceremony time, so rotation is one write and touches no customer organisation.
Three authorization rules carry the whole security surface of this:
- a distributor declares and rotates only its own connectors;
- a customer organisation may reference only its own distributor's connector — otherwise clinic A points at distributor B's authority and B mints sessions into A;
- and a connector serves only customer organisations in its own environment.
A connector proves itself before it may serve production: discovery reachable, keys resolvable, one real login round trip in test. The platform already promotes versions and configuration dev → prep → prod; an authority earns production the same way.
Accepted blast radius. One connector serving sixty clinics means a compromise there reaches all of them at once. Contained by per organisation enablement, the per organisation role map, the environment wall and the local door — but accepted deliberately, not discovered later.
There is a benefit on the other side of the same property: when a contract ends, disabling the connector ends delegated login for every customer organisation it served, in one action, while every hospital still gets in through its own account. That is only survivable because the local door exists.
Step 3 — the hospital decides to trust it
Kadri opens the customer organisation URL, signs in with the temporary credential and changes it. That is the consent point, and it is deliberately the first thing she does: the hospital exercises the door it controls before it comes to depend on any other.
She then sees what her distributor has proposed — "sign in with
What she is granting is not one switch but a set:
- delegated login — her staff sign in through the distributor's authority;
- people management — the distributor's directory may create and deactivate the clinic's practitioners;
- remote role management — the distributor's claims, through her map, govern who may do what.
They are separately enablable, because they are separate concessions. A clinic may accept its distributor's login without also accepting a roster push into its practitioner list.
The role map is hers even when the input is not. The distributor asserts a claim; the customer organisation decides what it means, deny-by-default — a claim her map does not name grants nothing. The distributor cannot widen rights on its own side, and this holds however the claims arrive.
When remote role management is on, local role edits are refused, not merged. Two writers and one truth: if she can hand-edit a role the next login recomputes, the clinic fixes something, it silently reverts, and neither side is trustworthy afterwards. On means the map governs and the local controls are visibly read-only. Off means people may still arrive by SSO while she grants their rights herself.
Her own administrator account is never remotely managed. If the distributor's directory could strip that role, the door the whole model rests on closes from the distributor's side. It sits outside the switch by construction, so the customer organisation always retains at least one locally-governed administrator.
Step 4 — the clinic's people
Two different questions get two different answers, and conflating them is where identity integrations usually go wrong.
Who works here is the distributor's directory to know. It pushes: the four GPs, two nurses and the receptionist exist as practitioners in the clinic's own project before any of them signs in — which matters, because a practitioner is referenced by orders, results, encounters and authoring tasks, and clinical structure cannot be built out of people who do not exist yet. When someone leaves, the distributor removes them where it always did, and their access ends without anyone opening a Jengu admin page. What they did stays in the record; it is their way in that closes.
What they may do right now is re-derived at every login from the claims the authority asserts, through the organisation's map. No sync lag, no drift, and a role revoked at the distributor is a role gone at the next ceremony.
Neither is redundant: one answers who is there, the other what may they do this morning.
The third option — Jengu polling the distributor's directory — is deliberately not taken. It would require Jengu to hold directory-read credentials and to pull a partner's employment data across the membrane, a materially larger PII surface than either alternative, for freshness the other two already provide.
Step 5 — the clinic configures its own equipment
Kadri enrols the edge box, watches its devices appear, and enables the device hub for her clinic herself.
None of this is a distributor API call. The edge is the clinic's hardware, in the clinic's back office, handling the clinic's patients. Every capability the distributor does not need is a capability it cannot get wrong — and the distributor's job ended when the clinic could sign in.
Never one door
The distributor owns the authority. If that were the only way in, it could lock a hospital out of its own record — during a billing dispute, or on the way out of a contract. So access is a ladder, each rung less convenient and louder than the one above:
- Delegated login — normal, instant, through the distributor's authority.
- The local administrator account — reset to the administrator's own address, needing neither distributor nor Jengu. Not a dormant path: it is how the customer organisation was opened in the first place, so it has been exercised before it is needed.
- Platform-side restoration — for the hijack case, where the addresses on file turn out to be the distributor's. Jengu mints or restores an administrator credential for a hospital contact verified out of band, through a channel that is not the distributor.
Rung 3 has a hard limit: Jengu hands the keys back, Jengu does not walk in. Platform admins are blocked from every customer organisation URL space by construction, and recovery must not puncture that — it mints access for the owner, it does not grant Jengu a session in a customer's customer organisation. Two named people request and approve it, it lands in the hospital's own trail, and it is counted. If it is not rare, the first-administrator rule is not working.
What each leg leans on
Every one of these is already promised elsewhere; the story leans on them rather than adding to them:
- a machine key that creates customer organisations, and customer tokens that cannot
- the customer organisation coming into existence from that one call, whole or not at all
- its configuration committed before anything is created
- every operation recorded in both the distributor's trail and the customer's
- suspension that is reversible and preserves the data
- login handed to whichever authority the customer declared
- claims nobody declared granting nothing
- a first login binding to the person already provisioned to receive it
- staff managed from the partner's own directory
- a local way in that survives the authority being unavailable
- the customer administrator's form writing to their own configuration
- a customer organisation that a caller without access cannot even tell exists
The story adds no new promise to that list. What it adds is the joins: the administrator named in step 1 is the identity step 3's consent is given by and step 4's provisioning has to agree about, before step 5 is reachable at all. No single-leg test crosses those seams, and delivery chains break at seams.