Enterprise Identity & Access Management Platform  ·  View 14 of 27  ·  Runtime

API Authorization

One API call, from client token to the row it is allowed to read.

Editable source SVG draw.io All views
Client application
Client application
Entra ID
Entra ID
API Management
API Management
Orders API
Orders API
Downstream API
Downstream API
Azure SQL
Azure SQL
1. auth code or client credentials
1. auth code or client credentials
2. access_token aud=api://orders
2. access_token aud=api://orders
3. GET /orders/{id} + Bearer
3. GET /orders/{id} + Bearer
4. validate-jwt: iss, aud, exp, signature
4. validate-jwt: iss, aud, exp, signature
5. require scp Orders.Read, quota by tid
5. require scp Orders.Read, quota by tid
6. forward + tenant id from claim
6. forward + tenant id from claim
7. app role check, then tenant predicate
7. app role check, then tenant predicate
8. on-behalf-of exchange
8. on-behalf-of exchange
9. downstream token, user-scoped
9. downstream token, user-scoped
10. call with delegated token
10. call with delegated token
11. result
11. result
12. managed identity + RLS context
12. managed identity + RLS context
13. rows for this tenant only
13. rows for this tenant only
14. 200 OK
14. 200 OK
15. 200 + correlation id
15. 200 + correlation id
16. 401 invalid_token / 403 insufficient_scope
16. 401 invalid_token / 403 insufficient_scope
API Authorization — token to gateway to backend to data
API Authorization — token to gateway to backend to data
No connection string and no client secret appears anywhere in this flow. The gateway rejects a malformed or foreign-tenant token before the backend is reached, and the backend still re-checks: the gateway is defence, not the authority.
No connection string and no client secret appears anywhere in this flow. The gateway rejects a malformed or foreign-tenant token before the backend is reached, and the backend still re-checks: the gateway is defence, not the authority.
v 1.0 · owner Data & AI Global Practice · date 2026-08
v 1.0 · owner Data & AI Global Practice · date 2026-08
Text is not SVG - cannot display

Decisions

  • The gateway validates and the backend re-checks. API Management is defence in depth, never the authority: a service reachable only through the gateway today becomes reachable another way tomorrow.
  • On-behalf-of is used where a downstream call must carry the user's identity, so the audit trail names a person rather than a service. Service-to-service calls with no user context use the workload's own identity instead.
  • The database is reached with a managed identity and a row-level security context. No connection string and no client secret appears anywhere in this flow.

Numbers

  • p95 added latency at the gateway is about 8 ms with OIDC metadata and JWKS cached; the first request after a cache expiry costs roughly 120 ms.
  • Token lifetime one hour, JWKS cache 24 hours, OpenID configuration cache 1 hour. These three values decide how fast an emergency key rotation propagates.
  • Quota and rate limits are keyed by tenant, so one tenant's traffic spike cannot consume another tenant's allowance.

Risks

  • Backends that trust a gateway-injected header rather than re-validating the token. Prevented by a contract test in the pipeline, because it cannot be prevented by documentation.
  • On-behalf-of adds a synchronous dependency on Entra inside the request path. Downstream tokens are cached for their lifetime, and the fallback is a degraded read-only response rather than a failure.
  • Long-lived refresh tokens held by public clients. Mitigated with PKCE, short-lived access tokens and CAE; eliminating them entirely would break offline mobile use.