Micro-Frontends identity and access
This page defines how authentication, authorization, and the real-time connection are owned and enforced across shells and MFEs. It realizes the architecture directives no role logic in MFE code, BFF per MFE, and one real-time connection per session. The capability model is shared with the platform Auth / AuthZ pattern; the MFE-specific SignalR model is shared with the MFE UI Interaction pattern.
Authentication — shell owns the session
A user should authenticate once, so authentication is a cross-cutting concern owned by the shell.
- The shell authenticates the user with MSAL against the shell’s Entra application (Alya = single-tenant Ontinue personas; Bondi / Veritas = multi-tenant customer personas).
- The shell holds the resulting account and acquires access tokens silently per API scope.
- Because MSAL is a shared singleton, every MFE sees the same MSAL context and can acquire a token for its own BFF scope without a second login.
- MFEs attach the token to their own outgoing BFF requests (the MFE is responsible for its own data access; the shell does not proxy domain calls).
The shell provides the MSAL context; it does not acquire domain tokens on behalf of MFEs. This keeps the shell out of the domain data path.
Authorization — capability-based contract
ION replaces scattered role checks with a capability contract resolved once and shared from the shell as part of the user context. The contract is minted and validated by Signet, the ION capability service — see Capability service (Signet) for the token anatomy, endpoints, build and validation steps, APIM product policy, and the BFF contract. The contract carries four things:
| Element | Meaning | Example |
|---|---|---|
scope | Which tenants the user may see | unrestricted: true (defender/advisor) or a single tenant (customer user) |
permissions | <DomainEntity>.<Read|ReadWrite> — an abstraction above Entra app-roles | Incident.Read, EM.ReadWrite |
mfe_access | Which MFEs the user may load | spi_initiatives |
shell | Which shell/persona context is active | alya | bondi |
Enforcement is layered, and each layer has a single clear responsibility:
- Shell builds the
UserContext(JWT + capabilities + requested scope) and checks MFE access (mfe_access) before mounting a remote. It obtains the capability token from Signet’sGET /v1/capabilitiesat login. - MFE (FE) checks permissions only to decide whether to show or hide UI affordances. It contains no role branching and makes no authorization decision of record.
- APIM validates the capability token against the request via Signet’s
POST /v1/validations(called with APIM’s managed identity): it checks scope against the request URL and a coarse read/write gate. The sanctioned URL convention is path-based (/<mfe-domain>/tenants/{tenantId}/...), so scope can be checked structurally. A403is returned at the edge before the BFF is reached. - MFE BFF re-verifies the capability token signature, binds it to the caller’s Entra identity, enforces the required permission(s) per route, applies shell-specific domain rules (e.g. Ontinue-owner vs customer-owner edits), and calls the domain service or store.
- Domain service remains the final authority on valid state transitions.
Design goals this satisfies: a single MFE works across shells, no role logic in MFE code, no duplicated authZ across BFFs, centralized capability + scope resolution, the domain owns final authority, and it works with multiple Entra apps (public + internal).
BFF per MFE
Each MFE has its own BFF. The user’s JWT terminates at the BFF; the BFF uses its own managed identity to reach shared resources and downstream services (per the platform service-to-service auth model). Frontends never call domain services directly.
A shared BFF is explicitly rejected: it would become a cross-team bottleneck and erode the independence that is the point of the MFE split. Per-MFE BFFs let the frontend and its backend evolve together.
Real-time connection lifecycle
Real-time updates follow the MFE UI Interaction pattern:
- The shell owns a single SignalR connection per browser session. After MSAL
login it calls the Shell SignalR BFF’s negotiate endpoint, which validates the
user’s Entra token and returns a SignalR client token bound to the user’s
oid. - The connection and its state (
connection,isConnected,error) are shared through@fe-ws/signalr, a Module Federation singleton. MFEs read them withuseSignalRand listen withuseHubEvent. The shell never parses business payloads and never invokes MFE methods. - Each MFE registers its own business subscriptions through its own BFF. The BFF
authorizes the user for the entity, then asks the Shell SignalR BFF (APIM
assgr-int) to add the user to the group{entity_name}-{entity_id}. Group membership is backend-controlled; the client never asserts it. - When the connection ID changes, MFEs re-register their subscriptions and issue a REST catch-up read to fill the gap.
- If the connection stays down, MFEs MUST fall back to REST polling. This rule is not implemented yet; see the real-time gaps.
This keeps connection lifecycle (shell) and business lifecycle (MFE) separate, bounds the connection count to one per session regardless of MFE count, and keeps the shell out of the business path.
The backend that realizes this — the single Shell SignalR BFF, the negotiate endpoint, the subscription API and group model, and the Service-Bus event fan-out — is documented in real-time (SignalR).
Multi-shell / multi-persona considerations
The same MFE (e.g. Service Requests) can run under both the Alya shell (Ontinue
personas, single-tenant Entra app) and the Veritas shell (customer personas,
multi-tenant Entra app). The difference in visible actions must be resolved through the
capability contract and the BFF, never by inspecting the shell name in MFE code.
Domain rules that differ by persona (e.g. Ontinue-owner vs customer-owner field edits)
are enforced in the BFF using the shell context from the capability contract.
Related documentation
- Architecture · Composition · Real-time (SignalR) · Capability service (Signet) · Implementation
- Pattern — Auth / AuthZ · MFE UI Interaction · UI Interaction
- ADR-0023 — Micro-Frontend (MFE) UI architecture
- Source references: MFE - Authentication & Authorisation Patterns · Event Sourcing - MFE UI Interaction Design Pattern