Principals: users, service accounts and OAuth clients
A principal (prn_) is someone or something that acts on the platform and can be held to
account for it. Every request the platform authorizes, every audit entry and every role assignment
points at a principal. There are two kinds: users (people) and service accounts (machines).
Two other populations sign in through FlowCatalyst but are deliberately not principals: portal identities (a client’s own customers) and field workers (frontline staff on shared devices). They live on separate identity planes and can never hold platform authority.
What every principal has
Section titled “What every principal has”| Property | Meaning |
|---|---|
| Id | A prn_ TSID, generated by the platform |
| Type | USER or SERVICE |
| Tier | ANCHOR, PARTNER or CLIENT: which clients it reaches (tenancy) |
| Home client | The one client a CLIENT-tier principal belongs to; none for anchors |
| Client grants | For a PARTNER, the clients granted to it |
| Applications | Every application, or a listed set (applications) |
| Roles | Named bundles of permissions: what it may do (permissions and roles) |
| Active | An inactive principal cannot sign in, and cannot get new tokens |
A user is a person with an email address. A user signs in either with a platform password (optionally with passkeys and a second factor) or through their organisation’s identity provider, depending on how their email domain is mapped (sign-in and federation). Applications never see the password: they send people to the platform to sign in.
Users arrive in several ways:
- an administrator creates them in the console or through
POST /api/principals/users; - an application creates them for itself (below);
- an application syncs its users and their roles with principal sync;
- they sign in for the first time through a federated identity provider, which creates them just in time.
A new user is client-tier unless the request asks for more, and asking for more is checked: ANCHOR
needs an anchor email domain, PARTNER needs a partner domain mapping, and both need an anchor-tier
administrator with the right to change client reach.
One safety rule protects the platform itself: no change may deactivate or demote the last active
anchor-tier user who reaches every application (LAST_ALL_APPLICATIONS_ADMIN). Someone must always be
able to grant access back.
Service accounts
Section titled “Service accounts”A service account is a machine identity. It is made of three linked records:
flowchart LR sa["Service account (sac_)<br/>code, name,<br/>webhook credentials"] prn["SERVICE principal (prn_)<br/>tier, roles,<br/>applications"] oc["Confidential OAuth client (oac_)<br/>client_id + secret"] sa --- prn --- oc
- The service account record (
sac_) holds its code, name and webhook credentials: a bearer token and an HMAC-SHA256 signing secret, used to authenticate and sign what the platform sends to it. - Its SERVICE principal (
prn_) holds what every principal holds: tier, roles and application access. Authorization always looks at the principal. - A confidential OAuth client (
oac_) lets it exchange a client id and secret for an access token with the client-credentials grant.
A service account’s tier follows its client links: none makes it ANCHOR, one makes it CLIENT, and
several make it PARTNER. The service account provisioned for an
application has no client links and is confined to its own application.
Secrets can be rotated without downtime: after a rotation the previous secret keeps working until its overlap ends (or an administrator ends it early), so a fleet can roll the new secret out first. An anchor-tier administrator who may edit a service account can also mint a token for it from the console, to test with, without seeing its secret. The mint is audited, and refused if the service account holds platform permissions the administrator does not.
OAuth clients are not principals
Section titled “OAuth clients are not principals”An OAuth client (oac_) is a registered OAuth 2.0 client. It is a door, not an actor:
- A confidential client for client credentials is linked to a principal (a service account’s). The token it gets is that principal’s.
- An interactive client (authorization code with PKCE) is how an application signs people in. The token it gets describes the person who signed in, narrowed to the client’s applications (tokens).
An OAuth client’s client_id is not a client id. Interactive clients pin their
redirect URIs (exact match), their allowed grants and whether PKCE is required.
Developer self-service credentials
Section titled “Developer self-service credentials”A developer often needs to call the platform API from a laptop or a test script, as themselves. Giving
each developer their own service account would clutter the platform with machine identities that are
really people. Instead, a user who holds the built-in platform:developer role can set a personal API
credential:
client_idis the user’s ownprn_id, andclient_secretis a dedicated secret, never their password. They set, rotate and revoke it from their profile.- They use the ordinary client-credentials grant, and receive a token with their tier and permissions.
- The developer role is checked again at every token request. Removing the role stops new tokens immediately, even if the secret still exists.
Users and invitations managed by an application
Section titled “Users and invitations managed by an application”An application with its own user administration can manage its users through the platform rather than beside it. Its service account creates users in the clients it is entitled to, with that application’s roles, and the platform keeps the identity:
- Who counts as the application’s users. Client-tier users homed at a client the application is enabled for, who hold at least one of its roles. The application sees only its own roles on them, never a password, token or second-factor state.
- The application can send its own invitation. Creating a user with
sendInvitation: falsesuppresses all platform email; the application sends its own message and, when the user arrives at sign-in, the platform asks them to create a password through an emailed link. Alternatively,returnInviteLink: truereturns a 72-hour set-password link for the application to embed in its own email, andinviteRedirectUrisays where the user lands afterwards. - Invitations are visible. An invitation is an active, internal user who has not set a password
yet:
PENDINGwhile the link is valid,EXPIREDafter. The application can resend one (the old link stops working) or revoke it, which deactivates the user.
The platform never accepts a first password typed straight into its sign-in page. The emailed link proves the person controls the mailbox before the account becomes theirs.
Who can see a principal
Section titled “Who can see a principal”An anchor sees every principal. Anyone else sees the principals homed at clients they can reach, and
the partners granted one of their clients. Any other principal, including an anchor user or a global
service account, answers 404 as if it did not exist. Reading yourself always works.