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
[](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_4COMPONENT STACK (8)
- Browser or appSTATEFULHolds the tokens; sits on an untrusted network
- Resource serverSTATELESSProtected API that trusts the gateway
- Identity provider (IdP)STATEFULSigns users in and issues tokens
- Session storeSTATEFULKeeps refresh tokens so they can be revoked
- API gatewaySTATELESSChecks the JWT signature, expiry and scope
- Policy decision point (PDP)STATEFULAllows or denies by the caller roles (RBAC)
- Audit logSTATEFULRecords who asked for what and the decision
- Time-series database (TSDB)STATEFULStores 401 and 403 counts scraped from the gateway
REQUEST & DATA FLOW (11)
- Browser or app → Identity provider (IdP) (Signs in (PKCE))[HTTPS]
- Identity provider (IdP) → Browser or app (Returns tokens)[HTTPS]
- Identity provider (IdP) → Session store (Saves session (SQL))[SQL]
- Browser or app → API gateway (Calls with JWT)[HTTPS]
- API gateway → Policy decision point (PDP) (Asks policy (mTLS))[HTTPS]
- API gateway → Resource server (Forwards (mTLS))[HTTP/2]
- Resource server → API gateway (Returns data)[HTTP/2]
- Policy decision point (PDP) → Audit log (Records decision)[HTTPS]
- API gateway → Browser or app (Relays response)[HTTPS]
- Identity provider (IdP) → API gateway (Publishes keys (JWKS))[HTTPS]
- Time-series database (TSDB) → API gateway (Scrapes 401 and 403)[HTTPS]