Micro-Frontends capability service (Signet)
The identity and access page states the design rule: role logic stays out of MFE code, and access is decided by a capability contract (scope + permissions + MFE access) resolved once and enforced at APIM and the BFF. This page documents the service that realizes that rule — Signet, the ION capabilities service — and the end-to-end flow by which a capability token is minted, carried, validated, and consumed.
It is grounded in the checked-in implementation at signet/ and the design
references below. Where a detail is not resolvable from source it is marked TBD
rather than invented.
| Fact | Value | Source |
|---|---|---|
| Service | Signet — ION capability service | signet/ |
| Runtime | .NET isolated Azure Functions (HTTP) | signet/app/src/Ontinue.Ion.Functions.Signet.Http |
| Short name | sgnt | SignetConstants.App.SIGNET_SERVICE_SHORT |
| Owner | mdr-ksp-team | CODEOWNERS (signet/) |
| External API (shell) | GET /v1/capabilities | signet/api/signet-ext-specs.yaml |
| Internal API (APIM) | POST /v1/validations | signet/api/signet-int-specs.yaml |
The platform Auth / AuthZ pattern defines the capability-based contract conceptually. This page shows how Signet implements it for MFEs. The two reference docs (Capabilities Service Design, Signet Capabilities and Validations — Test Use-Case) are the raw source of record.
Why a capabilities service
A single MFE (e.g. Service Management) runs under two shells — Alya (Ontinue personas, single-tenant Entra app) and Bondi (customer personas, multi-tenant Entra app). Encoding “who can do what under which shell” inside each MFE, and re-deriving it inside every BFF, would couple every team to every Entra role change.
Signet removes that coupling. It is the one place that reads raw Entra app-roles and projects them into a stable, shell-aware capability contract:
Entra roles are interpreted once, centrally.
PersonaResolver, RolePermissionsMap, RoleMfeAccessMap and ScopeBuilder live in Signet only. BFFs and MFEs never see Entra app-roles; they see permissions and scope.
The contract is an abstraction above Entra app-roles.
Permissions follow <DomainEntity>.<Read|ReadWrite> (e.g. Incident.ReadWrite). MFEs toggle UI on permissions; they never branch on a role name or a shell name.
The capability token is minted once and travels unchanged.
An RS512-signed token is produced at shell login and carried end-to-end. APIM and each BFF verify the same signature with a shared public key — no round-trips back to the resolver for the payload.
Coarse authZ is enforced before the BFF is reached.
APIM's MFE product policy calls Signet to validate scope and a coarse read/write gate, returning 403 before the request ever touches domain code. The BFF remains the final authority on per-resource rules.
The trust chain
The capability token is minted once, at shell login, and then rides every MFE→BFF request. Four parties verify different things; no party trusts the one before it blindly.
Trust boundaries, stated explicitly:
- Signet validates the Entra JWT — not APIM. The user’s raw token is the input to capability issuance; Signet checks signature, issuer, and expiry before it mints anything.
- The capability token is immutable in transit. It is signed once and carried via
the
X-Capabilitiesheader unchanged. Nothing downstream re-mints it. - APIM fails closed at the edge. A 403 from
/v1/validationsis returned to the caller before the BFF is invoked. - The BFF re-verifies and re-binds. It does not trust the header blindly — it re-checks the signature and binds the token to the caller’s Entra identity (see BFF contract).
Token anatomy
Signet mints a compact JWT distinct from the Entra token. Its explicit typ header is
what lets every verifier refuse to confuse the two.
| Part | Value | Source |
|---|---|---|
alg | RS512 (SecurityAlgorithms.RsaSha512) | CapabilitiesTokenSigner |
typ | cap+jwt (RFC 8725 explicit typing) | CapabilitiesToken.TOKEN_TYPE |
kid | urnioontinueionsignet | CapabilitiesToken.PUBLIC_KEY_SOURCE |
aud | mfe-apim | CapabilitiesToken.AUDIENCE |
| TTL | CapabilitiesConfig.TokenTtl (≈ 1 hour; expires_in in seconds) | CapabilitiesTokenSigner |
Claims:
| Claim | Meaning | Example |
|---|---|---|
sub | Entra object id (oid) of the user | 3fa85f64-… |
shell | Active shell context | alya | bondi |
persona_type | Persona class | internal | public |
scope | Tenant scope (see below) | { unrestricted: true } or { unrestricted: false, customers: [{ tenants: ["<tid>"] }] } |
permissions | <DomainEntity>.<Read|ReadWrite> set | ["Incident.ReadWrite", "SPI.Read"] |
mfe_access | MFEs the user may load | ["spi_initiatives"] |
entra_aud | The Entra aud this token was minted for (binding anchor) | <PortalAppId> |
iat / nbf / exp | Issued-at / not-before / expiry | unix seconds |
Key handling:
- The private signing key lives only in Signet’s Key Vault (issuer-only).
- The public verification key is published to shared App Configuration
(
CloudEventCryptoConfig/CapabilitiesCrypto) and resolved bykid, so APIM and every BFF can verify the signature without contacting Signet.
The Capabilities Service Design reference says “RS256 private key” in one line but specifies RS512 in the JOSE header and everywhere else. The implementation is authoritative: RS512 (
SecurityAlgorithms.RsaSha512,ValidAlgorithms = [RsaSha512]).
The two endpoints
Signet exposes exactly two surfaces, through two different APIM products, with two different callers.
GET /v1/capabilities — shell login
- API / product: public
signet-extAPI underapim-product-signet-ext-{env}. Caller: the shell, with the user’s Entra JWT. - Input:
Authorization: Bearer <Entra JWT>+X-Shell: alya | bondi. - Output (200):
{ "token_type": "capabilities", "expires_in": 3600, "token": "<RS512 JWT>" }, returned withCache-Control: no-storeandPragma: no-cache(the token is never cached). - Failures:
400for a missing Authorization orX-Shellheader;403with a machine-readablecode(ShellMismatch,EntraInvalid,NoPersona) when issuance is denied.
POST /v1/validations — APIM edge validation
- API / product: internal
signet-intAPI underapim-product-signet-int-{env}. Caller: APIM only, via managed identity (the user never calls this). - Input:
{ "capabilities_token": "<token>", "tenant_id": "<tid?>", "request_method": "GET|POST|…" }. - Output:
200with{ shell, permissions, … }when scope + write-gate pass;403otherwise. The BFF is never reached on403.
How a capability token is built
CapabilitiesService.IssueCapabilitiesTokenAsync runs these steps in order. Any
failure short-circuits with a 403 and a failure code.
Parse the requested shell
Owner: Signet
The X-Shell header is parsed into the Shell enum (bondi | alya). An
unrecognized value is rejected as ShellMismatch before any crypto work.
Validate the Entra JWT and extract claims
Owner: Signet
EntraTokenValidator validates signature, issuer, and expiry, then extracts
aud, tid, oid, and roles[]. Missing required claims → EntraInvalid. This is
the step that makes Signet — not APIM — the validator of the user’s identity token.
Resolve persona from aud + roles
Owner: Signet
PersonaResolver.Resolve(aud, roles) maps the audience (the Entra app the user
logged into — the primary anchor) plus the presented roles to a { shell, persona_type }:
Entra aud | Roles | → shell | → persona |
|---|---|---|---|
PortalAppId | Ion.Portal.* | bondi | public |
CaPortalAppId | Ion.User.Impersonation.* | bondi | public |
AlyaAppId | Ion.DefenderWorkbench.*, Ion.DefenderWorkbench.Customer.*, Ion.AutomationWorkbench.* | alya | internal |
No matching rule → NoPersona.
Cross-check the requested shell
Owner: Signet
The X-Shell header must equal the shell derived from aud. A customer token
cannot ask for an Alya capability set and vice-versa — mismatch → ShellMismatch.
Build permissions, MFE access, and scope additively
Owner: Signet
RolePermissionsMap.GetPermissionsForRoles(roles)unions every matching role’s permission bundle. Roles compose additively; unknown roles contribute nothing.RoleMfeAccessMap.GetMfeAccessForRoles(roles)unions each role’s MFE bundle.ScopeBuilder.Build(aud, tid, config)sets tenant scope (next section).
Example: customer Ion.Portal.ReadWrite yields ServiceRequest.ReadWrite,
Incident.ReadWrite, Asset.ReadWrite, Action.ReadWrite, SPI.ReadWrite,
Report.Read, GlobalConfiguration.Read plus RoE.Read / EM.Read /
AssetMapping.Read — i.e. RoE/EM/AssetMapping stay read-only for customers even with a
ReadWrite role (a domain rule encoded centrally, not in the MFE).
Sign RS512 and return
Owner: Signet
CapabilitiesTokenSigner.Sign stamps aud = mfe-apim, iat/nbf/exp, adds the
typ: cap+jwt header, and signs RS512 with the Key Vault private key. The service
returns { token_type, expires_in, token }.
Scope resolution
Scope answers “which tenants may this token touch”, and is deliberately narrow for customers and broad for Ontinue personas:
Persona (by aud) | Scope | AllowsTenant behavior |
|---|---|---|
Customer portal (PortalAppId) | { unrestricted: false, customers: [{ tenants: ["<own tid>"] }] } | only the caller’s own tenant |
CA portal / impersonation (CaPortalAppId) | { unrestricted: true } | any tenant (advisor acts across customers) |
Alya workbench (AlyaAppId) | { unrestricted: true } | any tenant (defender/coach) |
Only the customer portal app (PortalAppId) is tenant-restricted; every other persona
receives an unrestricted scope. This is the structural rule APIM relies on when it
checks the tenant_id from the request path.
Role → permission / MFE-access maps (current)
The maps are static and additive. Current state (abbreviated — RolePermissionsMap /
RoleMfeAccessMap are authoritative):
| Entra role | mfe_access | Notable permissions |
|---|---|---|
Ion.Portal.Read / .ReadWrite | spi_initiatives | ServiceRequest, Incident, Asset, Action, SPI, Report; RoE/EM read-only |
Ion.User.Impersonation.Read / .ReadWrite | spi_initiatives | advisor: RoE/EM/AssetMapping ReadWrite, SR/Incident read-only |
Ion.DefenderWorkbench.Customer.* (CA workbench) | spi_initiatives | ServiceRequest, SPI, CustomerConfiguration |
Ion.DefenderWorkbench.Portal.* (Defender) | — (none yet) | AllIncident, Investigation |
Ion.AutomationWorkbench.* (Coach) | — (none yet) | AutomationWorkbench (TODO in source) |
The Mfe enum currently defines a single value, spi_initiatives; additional MFEs are
added to the enum and the access map as they are onboarded.
APIM: the MFE product policy
MFE BFFs register under the shared apim-product-mfe-{env} product. The product
policy — not per-route wiring — performs capability validation on every inbound call:
The policy extracts the capability token from X-Capabilities, derives tenant_id
from the sanctioned path convention and request_method from the verb, and calls
/v1/validations using APIM’s managed identity (which is why the signet-int
product is internal-only). Onboarding a new MFE BFF is therefore adding it to the
product — no bespoke auth code per route.
Signet’s CapabilitiesValidator applies two coarse checks and fails closed:
- Tenant scope —
scope.AllowsTenant(tenant_id). A tenant-restricted token used on a route with no tenant parameter is rejected;unrestrictedpasses. - Coarse write gate —
GET/HEAD/OPTIONSalways pass; any other method (and any unknown method) requires at least one*.ReadWritepermission. This cheaply rejects read-only personas at the edge. Per-resource write rules remain the BFF’s job.
BFF contract — the backend half
APIM’s check is coarse and stateless. The BFF is the final authority and must not
trust the X-Capabilities header blindly. ION ships this as a shared NuGet so every
BFF enforces it identically.
Shared middleware
- Package:
Ontinue.Ion.Capabilities.Signet; register withservices.AddCapabilitiesValidation(configuration)and apply viaapp.UseWhen(isMfeRoute, …)so only MFE routes are gated. MfeCapabilitiesValidationMiddleware(headerX-Capabilities):- Reject if the header is missing/empty.
VerifyAndReadAsync— verify RS512 signature,typ = cap+jwt, lifetime, and thekid-resolved public key.- Bind to the Entra identity on the same request:
- re-validate the Entra JWT (signature/issuer/expiry),
entra.aud == claims.entra_aud,entra.oid == claims.sub,claims.scope.AllowsTenant(entra.tid).
- Store
CapabilityClaimsinFunctionContext.Items["CapabilityClaims"](SignetContractConstants.ContextItems.CAPABILITY_CLAIMS).
Binding is the critical step: it prevents a leaked or swapped capability token from being replayed by a different user or tenant — the token is only valid alongside the exact Entra token it was minted for.
Per-route responsibilities (R1–R6)
Per the Capabilities Service Design §7.1 contract, each BFF route must:
- R1 — confirm capability validation occurred (middleware present on the route).
- R2 — read verified claims from context, never re-parse the header itself.
- R3 — require the route’s specific permission(s) (e.g.
Incident.ReadWriteto close an incident). - R4 — apply shell-specific domain rules using the
shellclaim (e.g. Ontinue-owner vs customer-owner field edits). - R5 — re-check tenant scope for the specific resource being mutated.
- R6 — strip response fields the persona may not see.
The division of labor is deliberate: Signet owns resolution, APIM owns coarse edge rejection, the BFF owns per-resource enforcement, and the domain service remains the final authority on valid state transitions.
How the frontend consumes capabilities
The capability token changes nothing about how MFEs branch — because they do not branch on roles. Instead:
- Shell fetches the token at login (
GET /v1/capabilities), stores it in theUserContext, and gates which MFEs mount onmfe_access. A user withoutspi_initiativesnever loads the SPI remote. - MFE (FE) reads
permissionsfrom the shared context to show/hide UI affordances (e.g. render the “Close incident” button only ifIncident.ReadWriteis present). This is a UX optimization, not the authorization decision of record. - Every MFE→BFF request carries both the Entra token (
Authorization) and the capability token (X-Capabilities); APIM and the BFF make the real decision.
Because the contract is shell-aware, the same MFE build renders different actions
under Alya vs Bondi with no shell-name checks in MFE code — the difference is entirely
in the permissions, scope, and shell claims resolved by Signet.
Adoption status. The generated
CapabilitiesTokenClaimscontract type (mirroring thesignet-extOpenAPI schema) is already checked into each MFE undersrc/api/models/capabilities/(e.g.alya-fe/app-shell,service-management-fe,incidents-management-fe,security-posture-improvement,customer-info-fe), so every app shares one token shape. Runtime wiring (fetching the token at login and gating mounts/UI on it) is rolling out per MFE; today MFEs also still gate remote consumption on role arrays (withAuthorizedRemoteMF(remote, [UserRole.…])). See implementation.
Related documentation
- Identity and access · Architecture · Composition · Implementation
- Pattern — Auth / AuthZ
- Source references: Capabilities Service Design · Signet Capabilities and Validations — Test Use-Case · MFE - Authentication & Authorisation Patterns
- Code:
signet/app/src/Ontinue.Ion.Application.Signet/Services/CapabilitiesService.cs,.../CapabilitiesValidator.cs,signet/app/src/Ontinue.Ion.Core.Signet/Capabilities/,signet/app/src/Ontinue.Ion.Capabilities.Signet/,signet/api/signet-ext-specs.yaml,signet/api/signet-int-specs.yaml