Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_authn-authz-flow-v3

Authentication and authorization flow (authorization code with PKCE, JWT at the gateway)

9 COMPONENTS · 11 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[![Authentication and authorization flow (authorization code with PKCE, JWT at the gateway) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_authn-authz-flow-v3/opengraph-image)](https://archos.sageideas.dev/d/dgm_authn-authz-flow-v3)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_authn-authz-flow-v3)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_authn-authz-flow-v3" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Authentication and authorization flow (authorization code with PKCE, JWT at the gateway) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("Browser or app")]
  rs_1["Resource server"]
  idp_2[("Identity provider (IdP)")]
  session_3[("Session store")]
  gw_4["API gateway"]
  pdp_5[("Policy decision point (PDP)")]
  audit_6[("Audit log")]
  tsdb_7[("Time-series database (TSDB)")]
  capacity_8["Capacity Estimate"]
  client_0 -->|"1. Signs in (PKCE) · HTTPS"| idp_2
  idp_2 -->|"2a. Returns tokens · HTTPS"| client_0
  idp_2 -->|"2b. Saves session (SQL) · SQL"| session_3
  client_0 -->|"3. Calls with JWT · HTTPS"| gw_4
  gw_4 -->|"4a. Asks policy (mTLS) · HTTPS"| pdp_5
  gw_4 -->|"4b. Forwards (mTLS) · HTTP/2"| rs_1
  rs_1 -->|"5a. Returns data · HTTP/2"| gw_4
  pdp_5 -.->|"5b. Records decision · HTTPS"| audit_6
  gw_4 -->|"6. Relays response · HTTPS"| client_0
  idp_2 -->|"Publishes keys (JWKS) · HTTPS"| gw_4
  tsdb_7 -->|"Scrapes 401 and 403 · HTTPS"| gw_4

COMPONENT STACK (8)

  • Browser or appSTATEFUL
    Holds the tokens; sits on an untrusted network
  • Resource serverSTATELESS
    Protected API that trusts the gateway
  • Identity provider (IdP)STATEFUL
    Signs users in and issues tokens
  • Session storeSTATEFUL
    Keeps refresh tokens so they can be revoked
  • API gatewaySTATELESS
    Checks the JWT signature, expiry and scope
  • Policy decision point (PDP)STATEFUL
    Allows or denies by the caller roles (RBAC)
  • Audit logSTATEFUL
    Records who asked for what and the decision
  • Time-series database (TSDB)STATEFUL
    Stores 401 and 403 counts scraped from the gateway

REQUEST & DATA FLOW (11)

  1. Browser or app → Identity provider (IdP) (Signs in (PKCE))[HTTPS]
  2. Identity provider (IdP) → Browser or app (Returns tokens)[HTTPS]
  3. Identity provider (IdP) → Session store (Saves session (SQL))[SQL]
  4. Browser or app → API gateway (Calls with JWT)[HTTPS]
  5. API gateway → Policy decision point (PDP) (Asks policy (mTLS))[HTTPS]
  6. API gateway → Resource server (Forwards (mTLS))[HTTP/2]
  7. Resource server → API gateway (Returns data)[HTTP/2]
  8. Policy decision point (PDP) → Audit log (Records decision)[HTTPS]
  9. API gateway → Browser or app (Relays response)[HTTPS]
  10. Identity provider (IdP) → API gateway (Publishes keys (JWKS))[HTTPS]
  11. Time-series database (TSDB) → API gateway (Scrapes 401 and 403)[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →