Portal identity
A client often runs a portal for its own customers or suppliers: a customer portal, a supplier portal, a self-service site. The people who sign in there are not platform users. They do not administer anything on FlowCatalyst, and they belong to the client’s customers rather than to the client. FlowCatalyst still signs them in, so the portal gets password policy, password reset and single sign-on without building any of it. It does that in a separate identity plane.
The platform proves who someone is; the portal app decides what they may do.
The parts
Section titled “The parts”| Part | What it is |
|---|---|
Portal identity (ptu_) |
One per client and email address. Email, name, an optional password hash, a status (ACTIVE or DISABLED), the latest invitation’s dates, and its portal-app grants. No roles and no permissions, ever. One password across that client’s portals. |
Portal app (pta_) |
One named portal a client runs, with a code such as customer-portal. A client can run several. Identities are granted per app. |
| Portal OAuth client | The OAuth client the portal signs people in with. It is flagged with the client it belongs to and linked to the portal app it fronts. This flag is the only place “portal-ness” lives. |
| Identity provider | An authenticator, nothing more. If an organisation’s OIDC provider owns an email domain, every sign-in for that domain goes there, whether for the console or for any portal. |
| Membership | Lives in the portal application’s own database: organisations, portal roles, delegated administration. The platform never learns what an “organisation” means to the portal. |
Creating a portal app in the console also provisions its portal OAuth client in the same
transaction: authorization code only, PKCE required, scopes openid profile email, confidential by
default (or public for a browser-only portal). The client secret is shown once. Deleting the app
deletes its OAuth client too, rather than leave a client that would quietly let every portal
identity of the client in.
flowchart LR
U([Portal user])
subgraph App["Portal application"]
PA["Portal backend<br/>own session, own authorization"]
MDB[("Membership tables")]
end
subgraph FC["FlowCatalyst"]
AZ["/portal/authorize<br/>and sign-in page"]
TK["/oauth/token"]
ADM["/api/portal-users"]
PI[("Portal identities")]
end
Org["Organisation IdP"]
U --> PA
PA -->|"code + PKCE"| AZ
AZ -->|password| PI
AZ -->|"SSO for a mapped domain"| Org
PA -->|code exchange| TK
TK --> PI
PA -->|"invite, suspend, offboard"| ADM
ADM --> PI
PA --> MDB
Signing in
Section titled “Signing in”A portal sends people to /portal/authorize, not /oauth/authorize. The two entrances refuse each
other’s clients: a portal-flagged OAuth client is refused at /oauth/authorize, and a platform
client at /portal/authorize. A platform session counts for nothing on the portal side.
sequenceDiagram
autonumber
actor User as Portal user
participant App as Portal app
participant PZ as /portal/authorize
participant LP as Portal sign-in page
participant IdP as Organisation IdP
participant TK as /oauth/token
User->>App: open the portal
App->>PZ: redirect (portal OAuth client, PKCE, state)
PZ->>LP: park the request (15 minutes, single use)
User->>LP: email
alt domain owned by an OIDC provider
LP->>IdP: redirect to the organisation's sign-in
IdP-->>LP: verified identity (email domain enforced)
LP->>LP: create the portal identity on first sign-in, grant this app
else otherwise
User->>LP: portal password
LP->>LP: verify; then check the identity holds this app's grant
end
LP-->>App: redirect with an authorization code (10 minutes, single use)
App->>TK: exchange the code (secret + PKCE verifier)
TK->>TK: identity still ACTIVE, still granted, app still active?
TK-->>App: id_token (sub = ptu_…, portal claims) + identity-only access token
App->>App: known member? then start its own session
The rules that shape this:
- Every portal sign-in is fresh. No platform session cookie is set or reused, so there is nothing to sign someone in silently.
- Domain decides, as on the platform. A domain owned by an OIDC provider never authenticates by password, neither at sign-in nor through reset. The organisation stays the authority, so a person suspended there is suspended here.
- The app gate. Signing in through an app-linked portal client requires the identity to hold
that app’s grant. A password sign-in without it gets
NO_PORTAL_ACCESS, checked only after the password, so it tells someone who cannot prove the password nothing. A first SSO sign-in creates the identity and grants the app it came through. An existing identity without the grant is turned away. An inactive app refuses everyone. - Redemption checks again. The code exchange re-checks that the identity is active and still granted, so a suspension or revocation between sign-in and exchange kills the code.
- Passwords are typed only into platform pages: the portal sign-in page and the set-password page. A portal must not collect them in its own forms.
A portal OAuth client with no app link is a legacy client-wide portal: no grant check and no app code. It exists so older portals keep working.
What the portal receives
Section titled “What the portal receives”The exchange at /oauth/token returns:
- An id_token whose
subis theptu_id, with email and name, an emptyrolesclaim,portal_client_id, and for an app-linked clientportal_app_codeandportal_app_id, so the portal knows which of the client’s portals the person entered. - An identity-only access token (
token_use=identity). The platform API refuses it as a credential; its only use is proving authentication, for example at/oauth/userinfo. - No refresh token. The portal’s own session is the session. When it ends, the person signs in again.
Invitations and lifecycle
Section titled “Invitations and lifecycle”The portal application invites people, not the console. It calls POST /api/portal-users with the
email and its portalAppCode, using its own confined service account or a client administrator’s
credentials. The call is an idempotent ensure: it creates or reactivates the identity for that
client and email and grants the portal app. The invitation follows the domain:
- For a domain owned by an organisation’s provider, the email says “open the portal and sign in with your organisation”. No password ever exists; the first SSO sign-in completes the identity.
- Otherwise the email carries a set-password link valid for 72 hours. The set-password page applies the platform password policy and then returns the person to the portal.
- An identity that already has a password gets no email, so a portal can call ensure as often as it likes, for example from a sync job.
An invitation has two halves: the platform identity, and the membership row in the portal’s own database. That is why invitations come from the portal, which can write both.
The status administrators see is derived, never stored, so it cannot drift: Invited, Active (once a password exists or the person has signed in), Invite expired, and Suspended. The lifecycle is deliberately plain:
| Action | Effect |
|---|---|
Suspend (deactivate) |
Blocks the next code. The portal ends its own live sessions for an immediate cut |
| Reactivate | activate, or ensure again |
| Revoke one portal | Removes one app grant; access to the client’s other portals stays |
Offboard (DELETE) |
Removes the identity across all of the client’s portals. The portal deletes its membership first |
| Forgot password | Self-service from the portal sign-in page, 15-minute link; refused for SSO-owned domains |
Managing portal identities needs platform:iam:portal-user:view or …:manage, held through the
built-in platform:portal-administrator role. The permission is client-delegable: a holder reaches
only the clients their own tier reaches, so a client manages its own portal
population and nobody else’s.
Why a separate plane
Section titled “Why a separate plane”The first design gave portal users ordinary principals marked “inert”. That made safety depend on
every future authorization check remembering that such a principal must be ignored. A separate
plane makes leakage structurally impossible: a ptu_ subject is not a principal, never enters the
principal store, and carries no platform authority.
The cost is that the same email can exist in both planes, with independent credentials. That is benign, and normal when businesses serve other businesses: an administrator who checks the portal as a customer would see it is two identities on purpose. The failure mode of sharing a plane is authority leakage; the failure mode of separating them is a duplicated credential.
Two further choices follow from the same principle:
- Portal-ness lives on the OAuth client, not on the identity provider. One organisation’s provider can serve its staff in the console and its people in ten different portals. Binding a provider to one portal was tried and removed because it broke that case.
- Deciding who may sign in is the portal’s job. The platform vouches for who; the portal’s membership check decides whether. A valid sign-in with no membership row is refused by the portal.
Second factors for portal password users are not offered yet. People who sign in through their organisation’s provider bring that provider’s own MFA.
Read next
Section titled “Read next”- Build a customer portal: the portal side, in TypeScript and PHP.
- TypeScript SDK: portal and Laravel SDK: portal.
- Token claims: the portal id_token claims.
- Sign-in and federation: domain routing and the OIDC bridge.
- ADR 0026: a separate portal identity plane.