Identity Platform
1. Executive Summary
An identity platform is the authoritative system for authentication (proving who you are), authorization (what you may do), and identity lifecycle (provisioning, federation, offboarding) across workforce employees, customer users, and machine workloads. Modern platforms unify Workforce Identity (SSO via SAML/OIDC to corporate apps), Customer Identity and Access Management (CIAM) (registration, social login, MFA for B2C), and machine identity (SPIFFE, workload JWTs, service accounts) under consistent policy engines and audit.
Principal architects design identity platforms when fragmented login systems create security gaps, compliance failures, and poor user experience. This chapter covers a reference architecture serving 50M customer identities, 20K employees, 8K microservices—with OIDC as primary protocol, RBAC + ABAC policy layering, step-up authentication for sensitive actions, and zero standing admin access integrated with Zero Trust Architecture.
Safety: authentication failures deny access; authorization is default-deny. Liveness: cached JWKS and session stores must survive IdP degradation within defined bounds without bypassing MFA.
2. Why This Topic Matters
Identity is the control plane of security:
- Credential stuffing attacks exploit password reuse.
- OAuth misconfiguration causes cross-tenant data leaks in SaaS.
- Stale workforce accounts remain active after termination.
- B2B federation (SAML) errors break enterprise deals.
Principal interviews test OAuth2 flows, token lifetimes, refresh rotation, SCIM provisioning, and how identity integrates with API platforms and secrets management—not "we use Okta" without depth. Follow-ups on token binding, session fixation, and break-glass admin separate levels.
3. Problems Being Solved
| Problem | Platform capability |
|---|---|
| Password fatigue | SSO; passwordless passkeys |
| MFA enforcement | Adaptive risk-based step-up |
| Customer registration | CIAM with social IdPs |
| B2B enterprise SSO | SAML/OIDC federation per tenant |
| Service-to-service auth | mTLS + JWT with audience claims |
| Provisioning lag | SCIM sync from HRIS |
| Audit and compliance | Login logs; access reviews |
| Privileged access | PAM integration; just-in-time roles |
4. Assumptions and System Model
Functional
- Workforce SSO to 200+ SaaS apps via SAML/OIDC.
- Customer sign-up, login, password reset, MFA enrollment.
- OAuth2 authorization server for first-party and partner APIs.
- Admin console for role assignment and access reviews.
- SCIM inbound from Workday/Okta for user lifecycle.
- Machine auth: K8s SA tokens → OIDC → service JWT.
Non-functional
- Login p99 < 500 ms (excluding external IdP latency).
- Availability 99.99% for auth endpoints.
- Global deployment with data residency per region for CIAM PII.
- Support 10K auth RPS peak (product launch).
| Assumption | Implication |
|---|---|
| OIDC preferred over custom | Standard libraries; interoperable |
| Tokens are bearer unless bound | Short TTL; rotation; mTLS where possible |
| HRIS is source of truth for workforce | SCIM deprovision within 1 hour of termination |
| Customers may use social login | Account linking; email verification |
| Regulations vary by region | EU data in EU; consent logging |
5. Essential Terminology
| Term | Definition |
|---|---|
| IdP | Identity Provider—authenticates users |
| SP | Service Provider—relies on IdP (SAML term) |
| OIDC | OpenID Connect—identity layer on OAuth2 |
| SAML | XML federation standard for enterprise SSO |
| CIAM | Customer Identity and Access Management |
| SCIM | Cross-domain user provisioning protocol |
| RBAC | Role-Based Access Control |
| ABAC | Attribute-Based Access Control |
| MFA | Multi-Factor Authentication |
| Refresh token rotation | New refresh on each use; detect reuse |
| JWKS | JSON Web Key Set for token verification |
| Passkey | WebAuthn/FIDO2 passwordless credential |
| B2B federation | Per-tenant enterprise IdP trust |
6. Core Mechanism
6.1 Identity platform architecture
Figure 1: Unified identity platform—workforce federation, CIAM, and machine OAuth in one policy plane.
6.2 Authorization code flow (customer login)
Figure 2: OIDC authorization code flow with optional adaptive MFA.
6.3 Token and session model
Figure 3: Short-lived access tokens; refresh rotation detects theft.
6.4 Deep dives
B2B multi-tenant federation:
- Each enterprise tenant configures SAML metadata or OIDC discovery URL.
- Email domain routing:
@acme.com→ Acme IdP. - JIT provisioning creates user with tenant_id claim.
Authorization layering:
- Coarse RBAC:
billing_admin,viewer. - ABAC:
resource.owner_id == subject.user_id. - ReBAC (optional): Google Zanzibar-style relationship tuples for sharing graphs.
Machine identity:
- SPIFFE ID
spiffe://prod/ns/payments/sa/apiin JWTsub. - Audience claim
aud: payments-apienforced at gateway and service.
Offboarding:
- SCIM
DELETEoractive: false→ revoke all sessions within 60 s. - Event to API platform to invalidate outstanding refresh tokens.
7. Step-by-Step Walkthrough
7.1 Employee SSO to internal tool
- Employee visits
analytics.corp.com. - SP redirects to corporate IdP (OIDC).
- IdP asserts MFA satisfied; returns ID token + access token.
- SP validates JWT signature via JWKS cache.
- SP maps
groupsclaim to RBAC roles.
7.2 Customer passkey enrollment
- Logged-in customer opts into passkey.
- WebAuthn challenge from platform; credential stored hashed.
- Next login: passwordless assertion; risk score low → no SMS MFA.
7.3 OAuth misconfiguration incident
- Mobile app uses implicit flow (legacy)—token in URL fragment leaked via referrer.
- Fix: migrate to PKCE authorization code; rotate client secret.
- Postmortem updates Architecture Governance OAuth standards.
7.4 Service-to-service call
- Payment service requests token from AS with client credentials + mTLS.
- JWT contains
scope: payments.writeand SPIFFE sub. - Ledger service validates
audand scope before accepting write.
7.5 Regulatory audit of access decisions
- Auditor requests proof that terminated employees lost access within policy SLA.
- Export IdP audit log + SCIM event stream + session revoke events correlated by
user_id. - Identify 3 accounts exceeding 60-minute SLA—root cause delayed SCIM from contractor agency.
- Action: webhook from agency HR system; daily reconciliation job; dashboard for security review.
- Principal deliverable: access lifecycle diagram linking HRIS → SCIM → session store → API gateway blocklist—referenced in SOC2 evidence binder.
7A. Integration Summary
| Consumer | Identity capability | Contract |
|---|---|---|
| API Platform | OAuth AS, JWT validation | aud, scope, tenant_id |
| Secrets Management Platform | Workload JWT auth | SPIFFE sub binding |
| Zero Trust Architecture | MFA, posture, federation | Continuous session risk |
| SaaS apps | SAML/OIDC SSO | Attribute mapping per app |
8. Invariants and Guarantees
| Property | Type | Mechanism |
|---|---|---|
| AuthN before session | Safety | Credential verify first |
| Default deny AuthZ | Safety | Explicit policy grants |
| Token signature integrity | Safety | Asymmetric keys in HSM |
| Refresh reuse detection | Safety | Rotation family revoke |
| Session invalidation on offboard | Safety | SCIM + event bus |
| Login availability | Liveness | Multi-region IdP replicas |
9. Failure Scenarios
| Scenario | Mitigation |
|---|---|
| IdP regional outage | Secondary region; cached JWKS |
| JWKS rotation lag | Key overlap period; kid header |
| SCIM delay on termination | HR webhook + daily reconciliation |
| MFA provider down | Backup factor; break-glass policy |
| SAML clock skew | Skew tolerance; NTP monitoring |
| Token theft | Short TTL; rotation; binding |
| Directory split-brain | Single writer region; CRDT not typical |
| DDoS on /login | CDN + CAPTCHA + rate limit |
10. Performance Characteristics
10K auth RPS peak
Session store: Redis cluster < 5 ms p99
JWT validation at gateway: local JWKS cache < 1 ms
SCIM bulk sync: async queue; not hot path
Password hash: Argon2id tuned to ~200ms (anti-brute-force)
Directory read: replicated LDAP/DB with read replicas
11. Scalability Limits
| Limit | Mitigation |
|---|---|
| Session store memory | Shorter session TTL; stateless JWT where safe |
| SAML XML parsing CPU | Dedicated federation workers |
| JWKS fetch storm | CDN cache; push key update webhook |
| Global user count | Shard directory by region |
| Policy evaluation complexity | Compile policies; cache decisions briefly |
12. Operational Considerations
- SLO: 99.99% auth endpoint; 100% SCIM deprovision within 1 hour SLA.
- Dashboards: login success rate, MFA adoption, federation errors, token grant rate.
- Runbooks: key rotation, IdP metadata update, mass session revoke.
- Quarterly access reviews for privileged roles.
- Game day: primary IdP failure; verify read-only mode messaging.
13. Security Considerations
- PKCE mandatory for public clients; no implicit flow.
- Secure cookie flags:
HttpOnly,Secure,SameSite=Lax. - Rate limit login; credential stuffing detection.
- Admin actions require step-up MFA and PAM session recording.
- GDPR: consent logs; right-to-erasure workflow for CIAM.
- Integrate secrets for signing keys via Secrets Management Platform.
14. Cost Considerations
Okta/Auth0/Azure AD B2C licensing per MAU for CIAM. Self-hosted Keycloak reduces license but increases ops. MFA SMS costs add up—push WebAuthn. Engineering: custom policy engine vs OPA sidecar.
15. Production Implementations
| System | Pattern |
|---|---|
| Okta / Azure AD | Workforce SSO leader |
| Auth0 / Cognito | CIAM patterns |
| Keycloak | Self-hosted OIDC/SAML |
| Google Identity | B2B workforce |
| SPIFFE/SPIRE | Workload identity |
16. Alternatives and Tradeoffs
| Decision | Tradeoff |
|---|---|
| Central IdP vs per-app auth | Security vs migration cost |
| Stateful session vs JWT-only | Revocation speed vs scale |
| SAML vs OIDC for B2B | Enterprise demand vs modern DX |
| SMS MFA vs WebAuthn | Reach vs phishing resistance |
| Zanzibar vs RBAC | Expressiveness vs complexity |
| Build vs buy CIAM | Time vs customization |
17. Common Misconceptions
| Misconception | Reality |
|---|---|
| "JWT means stateless forever" | Revocation needs blocklist or short TTL |
| "OAuth is authentication" | OAuth is delegation; OIDC adds identity |
| "MFA once per device forever" | Step-up for sensitive actions |
| "Service accounts don't need rotation" | Machine creds need lifecycle too |
| "SAML is legacy only" | Still required for enterprise RFPs |
| "Groups in token are enough" | Fine-grained ABAC often needed |
18. Principal Architect Perspective
- Identity is platform, not per-team login page.
- Optimize for offboarding speed—slow deprovision is a breach waiting.
- Token design is API contract—claims must be stable and documented.
- Federation errors are revenue risks for B2B—monitor obsessively.
- Machine and human identity converge on OIDC patterns.
- Partner with security on zero-trust policy alignment.
19. Architecture Review Exercise
Scenario: Microservice validates JWT but ignores aud and accepts any signed token from corporate IdP.
Review: Cross-service token replay. Enforce audience, issuer, expiry, and scope at gateway and service. Document in API standards.
20. Whiteboard Explanation
"Workforce users federate through SAML or OIDC to our central authorization server. Customers use CIAM with passkeys and adaptive MFA. The OAuth server issues short-lived access JWTs and rotating refresh tokens. SCIM from HRIS deprovisions within an hour. Machine workloads get SPIFFE-based client credentials. Policy engine combines RBAC roles with ABAC attributes. API gateway validates JWKS with cached keys. Privileged admin uses PAM with just-in-time elevation. All login and admin events go to immutable audit for compliance."
21. Interview Questions
- Design identity for B2B SaaS with enterprise SSO. — Signals: SAML/OIDC per tenant, JIT provision. Red flags: one password DB.
- OAuth2 flows compare? — Signals: auth code+PKCE, client credentials. Red flags: implicit for SPAs.
- Refresh token rotation? — Signals: reuse detection, family revoke.
- JWT validation checklist? — Signals: sig, exp, iss, aud, scope.
- SCIM offboarding latency? — Signals: event-driven session revoke.
- MFA bypass risks? — Signals: step-up, risk engine. Red flags: permanent device trust.
- RBAC vs ABAC? — Signals: layering, policy engine.
- Machine identity at scale? — Signals: SPIFFE, short-lived JWT.
- Cross-region CIAM data residency? — Signals: shard directory, consent.
- Passwordless rollout? — Signals: WebAuthn, fallback factors.
- B2B SAML debugging? — Signals: metadata, clock skew, attribute mapping.
- Break-glass admin access? — Signals: PAM, time-bound, audited.
22. Interview Follow-Ups
- Token stolen from mobile app storage. — Short TTL, binding, secure enclave.
- Enterprise IdP cert expires unnoticed. — Metadata monitoring alerts 30d prior.
- Acquire company with separate IdP. — Federation bridge; gradual directory merge.
22A. Production Low-Level Design (Interview + Game Day)
Identity LLD: IdP control plane (users, sessions, policies) + token data plane (issue/validate).
Context diagram
Step-by-step flow:
| Step | Action |
|---|---|
| 1–2 | Authenticate; issue tokens |
| 3 | Resource servers validate |
| 4 | Lifecycle automation |
Production stack
| Layer | Choice | Role |
|---|---|---|
| IdP | Okta / Keycloak-class | SSO |
| Directory | SCIM sync | Source of truth |
| MFA | WebAuthn / TOTP | Assurance |
| Federation | SAML / OIDC | Apps |
| Privileged | PAM / JIT | Standing priv kill |
| Audit | SIEM | Terminations |
API + schema
POST /oauth/token
POST /logout
POST /admin/users/{id}/disable
POST /scim/v2/Users
| Entity | Fields |
|---|---|
user | id, status, attrs, mfa |
session | id, user, exp, device |
token | jti, aud, exp, scope |
Happy-path login
Failure — termination at 2AM
Observability + SLO
| SLI | Idea |
|---|---|
| Login success | |
| MFA challenge | |
| Time-to-revoke | Termination SLO |
| Token validate latency |
22B. Game Day Playbooks
Catalog
| ID | Drill | Inject | Signal |
|---|---|---|---|
| GD-1 | Immediate terminate | Fire user | Sessions dead |
| GD-2 | IdP region outage | Failover | Login SLO |
| GD-3 | Token alg confusion | Bad kid | Reject |
| GD-4 | SCIM flood | HR sync bug | Rate / DLQ |
| GD-5 | MFA bypass attempt | Policy | Block + alert |
| GD-6 | Orphan OAuth clients | Secret leak | Rotate |
GD-1 — Workforce termination (detailed)
GD-3 — JWT validation hardening (detailed)
Pass criteria: only approved issuers/algs; termination drill meets minute-level SLO.
23. Strong Answer Example
Question: "How handle workforce termination at 2 AM?"
Answer this as a 45-minute design discussion using the PRACTICE framework. Below is how a strong student sounds aloud—automated kill chain in minutes, not "HR emails Okta in the morning."

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.
Student interview script (PRACTICE)
P — Problem framing
"Termination at 2 AM is a security + identity lifecycle problem: the person may still have an active laptop, SSO sessions, refresh tokens, API keys, VPN, and cloud roles. Waiting until morning is an unacceptable exposure window.
Disabling an AD/Okta checkbox is not enough. Long-lived JWTs, refresh tokens, app session cookies, SSH keys, and SaaS SCIM lag can keep access alive.
Short answer: Event-driven offboarding—HRIS → SCIM/deprovision → IdP disable + revoke sessions/refresh → fan-out
user.revokedto apps/gateway/PAM—with short access-token TTL, server-side session kill, and an SLA (policy max e.g. 60 minutes; target ~5 minutes automated). On-call runbook if automation fails."
R — Requirements
| Requirement | Design |
|---|---|
| Works unattended at 2 AM | Fully automated from HRIS event |
| Kill interactive SSO quickly | Revoke IdP sessions + refresh tokens |
| Kill API / gateway access | Blocklist sub / introspection / short JWT TTL |
| Kill privileged sessions | PAM / break-glass close on revoke |
| SaaS apps (GitHub, Salesforce…) | SCIM deprovision / group removal |
| Prove it for audit | Correlated timeline HRIS → last successful auth |
"I'd ask: contractor vs FTE? High-risk admin? Which apps are SCIM vs JIT-only?"
A — Assumptions (state aloud)
| Assumption | Why it matters |
|---|---|
| HRIS is workforce source of truth | Termination event must be reliable |
| Central IdP (Okta/Entra/Keycloak-class) | SSO + token issuance hub |
| Mix of OIDC/SAML apps + APIs | Different revoke mechanisms |
| Access JWTs are short-lived | Can't wait hours for natural expiry |
| Some credentials are non-SSO | Keys, tokens, certs need explicit disable |
"I'd state the exposure metric:
time(HRIS terminate → last successful auth)."
C — Capacity
SCIM / webhook path → low QPS; must be HA (termination is rare but critical)
Session store DEL fan-out → O(sessions per user); fine at human scale
Gateway blocklist → hot cache; TTL ≥ access-token lifetime
Mass layoff edge case → queue + rate-limit SaaS SCIM; prioritize VIP/admin first
Reconciliation job → nightly catch missed SCIM
"I'd optimize for correctness and latency of revoke, not throughput—unless mass RIF."
T — Topology (draw this)

Figure B: HRIS → IdP disable/revoke → apps/sessions/keys/PAM; SLO minutes, not next business day.

Figure C: JWTs, refresh tokens, cookies, API keys, VPN certs, break-glass—each needs an explicit kill.
| Layer | 2 AM action |
|---|---|
| HRIS | Mark terminated (source event) |
| IdP | Disable login; remove groups; revoke refresh; end IdP sessions |
| Session store | DEL all sid for user_id |
| Access tokens | Short TTL (e.g. 5–15m) + optional denylist/introspection for high-risk |
| API gateway | Cache sub revoked until tokens expire |
| Apps | SCIM deprovision; SAML/OIDC back-channel logout where supported |
| Secrets / keys | Disable personal access tokens, SSH keys, cloud keys |
| PAM / VPN | Kill elevated + network sessions; revoke certs |
| Audit | Immutable log of each step |
I — Invariants (safety)
"Non-negotiable:
- Termination is automated—no 'wait for morning email.'
- Disable account ≠ revoke tokens/sessions—do both.
- Refresh token families revoked (reuse detection still on).
- Access token lifetime bounds residual risk after revoke.
- Machine/personal keys in scope, not only SSO.
- Measurable SLA with alerts when breached.
- Break-glass accounts reviewed; never shared with the terminated user."
C — Constraints (second C)
| Constraint | Design response |
|---|---|
| Long-lived JWT-only apps | Force short TTL or session store; migrate offenders |
| SCIM-lagging SaaS | Webhook + retry + daily reconcile; priority queue for admins |
| Offline laptop / cached creds | Device management wipe/cert revoke; VPN posture |
| IdP outage at 2 AM | Runbook: emergency gateway blocklist from HRIS feed; status |
| Contractor agencies delayed HRIS | Contractual SLA; shadow IT inventory |
| Insider already exfiltrated tokens | Assume breach playbook; rotate shared secrets if needed |
E — Evolution (prove it)
Phased delivery:
| Phase | Deliverable |
|---|---|
| M1 | ADR: offboarding SLO (target 5m / max 60m) + kill-chain matrix |
| M2 | HRIS → SCIM webhook → IdP disable + session/refresh revoke |
| M3 | user.revoked → gateway blocklist + PAM close |
| M4 | SCIM to critical SaaS; PAT/SSH/key disable automation |
| M5 | Metric: HRIS→last-auth; alert on SLA breach; chaos terminate test user at night |
| M6 | SOC2 evidence binder: sample timelines |
Failure modes:
| Failure | Mitigation |
|---|---|
| Manual Okta click next morning | Automate from HRIS |
| Disable user, leave refresh valid | Revoke refresh families |
| JWT valid for hours | Short TTL + denylist for sensitive APIs |
| Missed SaaS app | Inventory + reconcile |
| No audit trail | Correlate SCIM + session + gateway events |
Observability: deprovision lag p50/p99, sessions killed count, refresh revoke count, gateway blocklist hits, last-auth-after-terminate gauge, failed SCIM per app.
Closing line (interview)
"So for workforce termination at 2 AM, I don't wait for email. HRIS fires SCIM, the IdP disables the user, revokes sessions and refresh tokens, publishes
user.revokedso the gateway blocklists the subject and PAM kills elevated sessions, and we SCIM-deprovision SaaS plus disable keys/certs. Access JWTs stay short-lived so residual risk dies in minutes. I'd target ~5 minutes automated with a hard 60-minute policy ceiling, alert on breach, and prove it withtime(terminate → last auth)in the audit pack."
Scoring signals
| Strong | Weak / red flag |
|---|---|
| Automated HRIS→SCIM kill chain | "HR emails Okta in the morning" |
| Sessions + refresh + keys, not just disable | Checkbox-only disable |
| Short JWT TTL / gateway blocklist | Hours-long access tokens ignored |
| SLA + metric + on-call runbook | No measurable window |
| SaaS SCIM + reconcile | SSO-only thinking |
| PAM / break-glass included | Forget privileged path |
Compact outline (if time-boxed to 2 minutes)
"Automate: HRIS→SCIM→IdP disable, revoke sessions/refresh, user.revoked to gateway/PAM, SCIM SaaS, kill keys. Short access TTL. Target ~5 min, max 60. Measure last-auth-after-terminate. Don't wait for morning email."
24. Weak Answer Example
Question: "How handle workforce termination at 2 AM?"
"We use Okta and disable users manually when HR emails."
Why weak / red flags: No automation or night-time SLA, no session/refresh/key revoke, no gateway fan-out, no measurable terminate→last-auth—leaves hours of lingering access.
25. Hands-On Exercise
- Deploy Keycloak; configure OIDC client with PKCE SPA.
- Implement JWT validation middleware checking aud/iss/exp.
- SCIM mock provision and deprovision user; verify session kill.
- Configure SAML federation with test IdP; debug attribute mapping.
- Extension: Refresh token rotation with reuse detection test.
- Extension: OPA policy for ABAC on sample API.
26. Knowledge Check
- OIDC vs OAuth2 responsibility split?
- Why PKCE for public clients?
- SAML assertion vs OIDC ID token?
- What claims belong in access vs ID token?
- SCIM operations for offboarding?
- JWKS rotation strategy?
- Passkey phishing resistance mechanism?
- Client credentials flow use case?
- Session fixation prevention?
- Tenant isolation in B2B CIAM?
- When step-up MFA?
- SPIFFE ID in JWT benefit?
27. Flashcards
| Front | Back |
|---|---|
| OIDC | Identity on OAuth2 |
| PKCE | Public client code exchange protection |
| SCIM | Automated user provisioning |
| JWKS | Public keys for JWT verify |
| Refresh rotation | Detect token theft via reuse |
| CIAM | Customer identity management |
| ABAC | Attribute-based policy |
| WebAuthn | Passkey standard |
| aud claim | Intended token recipient |
| Federation | Trust external enterprise IdP |
| Step-up MFA | Extra auth for sensitive action |
| SPIFFE | Workload identity framework |
28. Cheat Sheet
IDENTITIES: workforce | customer | machine
PROTOCOLS: OIDC primary; SAML B2B; SCIM provision
TOKENS: access 15m; refresh rotated; validate aud/iss/exp
MFA: adaptive risk; WebAuthn preferred
FEDERATION: per-tenant metadata; domain routing
MACHINE: client credentials + mTLS + SPIFFE sub
OFFBOARD: SCIM → revoke sessions + refresh
POLICY: RBAC coarse + ABAC fine
AUDIT: all login/admin events immutable
ZERO TRUST: identity + device + context
28A. Principal Interview Deep Dive
B2B federation failure modes
Enterprise SSO integrations fail in production for predictable reasons—principal architects prepare:
| Failure | Symptom | Mitigation |
|---|---|---|
| Metadata cert expiry | All logins fail for tenant | 30/14/7 day alerts; automated metadata fetch |
| Attribute mapping drift | User provisioned without role | Contract test against IdP sandbox |
| Clock skew | SAML assertion rejected | NTP monitoring; skew tolerance documented |
| JIT provisioning race | Duplicate users | Idempotent provision by external_id |
| IdP outage | Enterprise customers blocked | Cached session; status page; contractual RTO |
Token design as API contract
Access token claims must be stable, documented, and minimal:
Required: sub, iss, aud, exp, iat
Tenant: tenant_id (B2B)
AuthZ: scope or roles (prefer scope for APIs)
Avoid: PII in token (email in ID token only)
Breaking change policy: adding optional claims is safe; renaming claims requires new API version. Coordinate with API Platform JWT validation middleware.
Machine identity at scale
8,000 K8s pods × cert TTL 24h → 333 cert issuances/hour average
SPIRE or mesh CA must automate; manual cert ops impossible
Rotation: rolling pod restart vs hot reload depends on mesh choice
Blast radius: compromised SA in namespace X → policy limits paths to namespace X only
Offboarding SLA as security invariant
Safety: Terminated employee session invalid within 60 minutes (target 5 minutes automated). Liveness: IdP degradation may delay revoke—document maximum exposure window in risk register.
Measure: time(HRIS termination event → last successful auth)—dashboard for security review.
Interview scenario: OAuth for mobile + SPA + server
| Client | Flow | Pitfall |
|---|---|---|
| SPA | Auth code + PKCE | Storing refresh in localStorage |
| Mobile | Auth code + PKCE + attestation | Custom URL scheme hijack |
| Server | Client credentials + mTLS | Shared secret in image |
Principal answer maps each client to flow with explicit threat mitigation—never one-size-fits-all.
29. Related Concepts
- Security Architecture Fundamentals
- Zero Trust Architecture
- API Platform
- Secrets Management Platform
- HTTP, TLS, and QUIC
- Architecture Governance
19A. Extended Review Scenario
Scenario B: Mobile app stores refresh token in localStorage; XSS on marketing subdomain steals token.
Review: Public client must use PKCE auth code flow; refresh token in httpOnly cookie or secure enclave—not localStorage. Implement strict Content-Security-Policy on all subdomains. Short access token TTL (15 min). Refresh rotation with reuse detection revokes token family on theft. Add security regression test in CI scanning mobile repo for forbidden storage patterns.
23A. Additional Strong Answer
Q: Design B2B multi-tenant identity for SaaS with per-customer SAML.
Outline: Each enterprise tenant record stores IdP metadata URL, attribute mapping (groups → roles), and JIT provisioning rules. Email domain routing resolves tenant on login. SP-initiated and IdP-initiated flows supported. Tenant isolation: tenant_id claim in every token; authorization policies deny cross-tenant API paths. Admin console for tenant self-service metadata upload with validation. Sandbox IdP for integration testing. Monitor federation error rate per tenant—sales alert if enterprise login fails >1%. SCIM outbound optional for provisioned app roster sync.
28B. Extended BOE Walkthrough (Interview Script)
Interviewer: "Design identity for B2B SaaS with enterprise SSO."
Strong candidate:
"B2B means tenant-per-enterprise with SAML or OIDC federation. Customer users may also use local CIAM with passkeys for SMB segment.
Federation broker routes @acme.com to Acme IdP metadata. JIT provisioning creates user with tenant_id and mapped groups → roles. SCIM from customer optional for roster sync.
OAuth authorization server issues access JWT 15-minute TTL, refresh rotation with reuse detection. Machine workloads use SPIFFE client credentials—separate from human flows.
Offboarding: SCIM or admin disable → revoke all sessions within 60 minutes target. Audit every login and admin action.
Token validation at API Platform gateway: iss, aud, exp, tenant_id required.
Data residency: EU tenants in EU directory shard—legal not optional.
Break-glass admin via PAM with recording—not shared root password."
30. References
- OAuth 2.0 RFC 6749 and OIDC Core 1.0 — protocol standards.
- SAML 2.0 OASIS specification — enterprise federation.
- SCIM RFC 7644 — provisioning protocol.
- NIST SP 800-63B — digital identity guidelines.
- FIDO2/WebAuthn specifications — passwordless authentication.
Distinction: RFC security requirements are normative; vendor IdP feature sets vary; regional privacy law drives data residency implementation choices.
30A. Further reading paths
Study Zero Trust Architecture for continuous verification model, API Platform for JWT validation at gateway, and Secrets Management Platform for signing key storage. Walk through B2B SAML metadata exchange on paper—principal candidates should explain attribute mapping, clock skew, and certificate rotation without conflating SAML with OIDC.
Lab: Configure Keycloak SAML IdP + OIDC client; test SCIM deprovision kills active sessions. Interview drill: compare authorization code + PKCE vs client credentials—when each applies, what attacks each prevents, and common mobile/SPA misconfigurations that leak tokens.