The design review for the broker portal's new quote API is on slide four. The slide titled "Auth" says three words: OAuth, JWT, Okta. Every word is true, and the reviewer still has no design to review. OAuth is a protocol: it says how a client obtains a token. JWT is a token format: it says how claims are packed and signed. Okta is a product: an identity provider the insurer would rent, which implements those standards. Not one of the three says whether broker u-broker-n1 (tenant brk-north) may read quote Q-6620, which belongs to brk-south. That decision is made in the quote service, on the record, and the slide has no word for it.
So the reviewer asks the question this page asks of every name: what kind of thing is it, what does it decide, and what stays in your code? A valid token is not a permission, and no product name is an authorization design.
Seven kinds of thing#
A standard is a published document that says what implementations must do: OAuth 2.0 is RFC 6749. A token format is a standard for one artifact: a JWT is a signed JSON object. A guideline advises without a wire format: NIST SP 800-63-4 says how strong authentication should be. A library is code you link into your service: Spring Security. A product is software or a service you run or rent: Keycloak, AWS IAM. An engine evaluates policy you write: OPA evaluates Rego. A pattern is an architecture choice no standard mandates: the backend for frontend (BFF).
Before AI. In 2010 the same slide said "LDAP and Spring Security". LDAP is a directory protocol, Spring Security a library; neither said which branch manager could approve which loan. The confusion is old. What is new is the number of names, and that an AI agent now calls the same APIs.
| Name | Kind | What it decides | What stays in your code |
|---|---|---|---|
| OAuth 2.0 | protocol | How a client gets and presents a token | Which record it may touch |
| OpenID Connect | protocol | Who logged in (ID token) | Sessions, authorization |
| SAML 2.0 | protocol | Signed assertions for federated login | Attributes to entitlements |
| SCIM 2.0 | protocol | Account and group create and remove | Enforcing active |
| TLS, mTLS | protocol | The peer holds its certificate's key | What that peer may call |
| WebAuthn | API standard | Phishing-resistant proof of a key | Recovery, step-up |
| MCP authorization | protocol | Token discovery, audience binding | Tool and argument policy |
| A2A security schemes | protocol | Credentials an agent accepts | What a caller may ask |
| JWT, JWS, JWE, JWK | token format | Signing, encryption, keys | Which claims you accept |
| NIST SP 800-63-4, 800-207 | guideline | Assurance levels; zero-trust roles | Every control |
| OWASP, RFC 9700 | guideline, BCP | Known failures and fixes | Applying them |
| Spring Security, FastAPI + PyJWT | library | Token validation, coarse checks | The object-level rule |
| Next.js BFF, Auth.js | pattern, library | Where sessions and tokens live | Checks near the data |
| Keycloak, Okta, Auth0, Entra ID, Cognito | product: identity provider | Login, tokens, coarse roles | Record-level decisions |
| AWS IAM, Google Cloud IAM, Azure managed identities | product: cloud identity | Which workload calls which cloud API | Your records |
| API gateway authorizers | product feature | Coarse token checks at the edge | Object-level checks |
| OPA, Cedar, OpenFGA | engine | Allow or deny on the facts sent | Facts, HTTP answer, error = deny |
| PostgreSQL RLS | database feature | Rows a database role sees | Setting the tenant |
| AuthZEN Authorization API | API standard | PEP-to-PDP request shape | The policy |
| SPIFFE, SPIRE | standard, product | An identity per workload | What it may do |
Diagram: Seven kinds of thing called auth · what each one decides, from the wire to the record
Read the lanes from top to bottom. Standards and token formats say what must happen on the wire. Guidelines say how strong it should be. Libraries and products implement the standards. Engines evaluate a policy you wrote. The last lane is your code, and it is the only lane that knows whether broker u-broker-n1 may read Q-6620. Every name on a design slide belongs in exactly one lane; a slide with nothing in the last lane has no authorization design.
- Standards and token formats
- OAuth 2.0, OIDC, SAML, SCIM: Documents that say what implementations MUST do on the wire: how tokens are obtained, how logins and accounts move.
- TLS, WebAuthn, MCP, A2A, SPIFFE: Standards that prove possession of a key, or bind tokens to one server or agent.
- JWT, JWS, JWE, JWK: How claims are signed, encrypted and keyed; never what the holder may do.
- Guidelines
- NIST SP 800-63-4, SP 800-207: Advice with SHALL and SHOULD, no wire format: how sure, how strict.
- OWASP, RFC 9700: Lists of mistakes and the controls against them.
- Libraries and products
- Spring Security, FastAPI + PyJWT: Code in your process that validates tokens and runs your checks.
- Keycloak, Okta, Auth0, Entra ID, Cognito: Products that authenticate principals and issue tokens implementing OAuth and OIDC.
- Cloud IAM, gateway authorizers: Decide which workload may call which cloud API, and check tokens at the edge.
- Engines
- OPA, Cedar, OpenFGA: Evaluate the rule you wrote against the facts you send; none authenticates the caller.
- PostgreSQL RLS, AuthZEN API: Row filtering under every query; a standard request shape between PEP and PDP.
- Your code
- facts for the decision: Loads the record and sends tenant, unit and assignment to the PDP; no product knows them.
- the answer on every path: Turns allow or deny into the HTTP answer and treats an engine error as deny.
Common confusion. "We log in with OAuth." OAuth 2.0 issues access tokens to clients; it defines no login. Login is OpenID Connect, which adds the ID token. An access token used as proof of login, or an ID token sent to an API, crosses a boundary its standard never promised.
In our insurance example. The example's identity provider and demo tokens are stand-ins (HMAC-signed, JWS-shaped; use a maintained library in production). The six demos inexamples/frameworks/ran real libraries and engines on one rule: a broker reads only their tenant's quote;decision.recordonSUB-1004needs the assigned underwriter with strongacr; the agent is always denied. The agent is a scripted stand-in, so these results show how the access controls work, not how good any model is.
Each section below gives a bold label (kind, version, date read), a one-sentence definition, and a table: what it solves, the minimum implementation ("ran here" or "documented shape; not run here"), responsibility, failure modes, strengths, limits, trust, version and docs. No ranking, no prices.
Standards and protocols. Documents that say what implementations MUST do on the wire. You use them through a library or product.
OAuth 2.0#
Standard (protocol, RFC 6749, read 2026-11-18). An authorization server issues access tokens to a client, which calls a resource server for a resource owner or for itself.
| Field | Detail |
|---|---|
| Solves | Calling an API without holding the person's password |
| Minimum | Authorization code + PKCE for people, client credentials for services; not run here (OAuth and OIDC) |
| Responsibility | Decides: which client gets which scopes for which audience. Yours: whether the caller may touch Q-5531 |
| Fails when | Audience unchecked; open redirect; deprecated grants kept |
| Strengths | Clients never handle user passwords |
| Limits | No login, no object-level authorization |
| Trust | The authorization server's keys and client registrations |
| Verified | Updated by RFC 8252, 8996, 9700. OAuth 2.1 is still a draft: -17, 31 October 2026, "Obsoletes: 6749, 6750 (if approved)"; PKCE required, implicit and password grants gone. MCP cites -13 |
| Docs | RFC 6749, OAuth 2.1 draft |
OpenID Connect#
Standard (protocol, OpenID Connect Core 1.0, read 2026-11-18). An identity layer on OAuth 2.0: the provider returns an ID token saying who authenticated, how and when.
| Field | Detail |
|---|---|
| Solves | Federated login with a verifiable statement |
| Minimum | Code flow, openid scope; check iss, aud = your client_id, exp, nonce; not run here |
| Responsibility | Decides: who the user is (acr, amr, auth_time on request). Yours: session and every authorization |
| Fails when | ID token sent to an API; email_verified read as real-world identity |
| Strengths | Discovery and JWKS automate configuration |
| Limits | Says nothing about permissions |
| Trust | The issuer string (must match exactly) and its keys |
| Verified | Core 1.0 errata set 2, 15 December 2023 |
| Docs | Core, Discovery |
SAML 2.0#
Standard (protocol, OASIS SAML 2.0, read 2026-11-18). An identity provider (asserting party) sends signed XML assertions about a principal to a service provider (relying party).
| Field | Detail |
|---|---|
| Solves | Single sign-on across organizations |
| Minimum | Web Browser SSO, SP-initiated, HTTP POST binding; not run here |
| Responsibility | Decides: authentication and attribute statements. Yours: attributes to roles and records |
| Fails when | Unsigned or misaddressed assertions accepted; groups trusted as entitlements |
| Strengths | Roles, bindings, profiles and single logout specified |
| Limits | Browser redirects and POSTed XML forms |
| Trust | The IdP signing certificate from metadata |
| Verified | Overview Committee Draft 02 (2008, non-normative); core March 2005 |
| Docs | Technical overview |
SCIM 2.0#
Standard (protocol, RFC 7643 and 7644, read 2026-11-18). A REST schema and protocol for creating, changing and removing users and groups in a target system.
| Field | Detail |
|---|---|
| Solves | Joiners get accounts and leavers lose them, without tickets |
| Minimum | /Users, /Groups, PATCH; active false on leave; not run here (Governance) |
| Responsibility | Decides: the account data the target holds. Yours: honouring active and groups on every request |
| Fails when | Account disabled, sessions and tokens still valid |
| Strengths | One push from the identity source to every app |
| Limits | Defines no authentication or authorization scheme of its own |
| Trust | The SCIM endpoint needs strong client authentication |
| Verified | September 2015; updated by RFC 9865 (cursor pagination) and RFC 9967 (events as SETs, May 2026) |
| Docs | RFC 7643, RFC 7644 |
TLS and mTLS#
Standard (protocol, RFC 9846, read 2026-11-18). TLS 1.3 authenticates the server and optionally the client; in mutual TLS the server requests a certificate and the client proves its key with CertificateVerify.
| Field | Detail |
|---|---|
| Solves | Confidential transport; proof of key possession at each end |
| Minimum | Server TLS everywhere; mTLS between services from a private CA; not run here (TLS and PKI) |
| Responsibility | Decides: the peer holds a trusted certificate's key. Yours: which identity may call which operation |
| Fails when | Any certificate from the CA accepted; expiry outage |
| Strengths | No bearer secret to replay |
| Limits | Rotation, revocation; a certificate is not business authorization |
| Trust | Every CA in your trust store |
| Verified | RFC 9846 (July 2026) obsoletes RFC 8446, still version 1.3. Let's Encrypt stopped client-authentication certificates on 8 July 2026 and points to private CAs |
| Docs | RFC 9846 |
WebAuthn#
Standard (W3C API, WebAuthn Level 3, read 2026-11-18). A browser API for registering and authenticating with public-key credentials bound to the relying party's domain; passkeys are discoverable credentials.
| Field | Detail |
|---|---|
| Solves | Phishing: the credential works only for its RP ID |
| Minimum | A server library; userVerification required for MFA; not run here (Authenticators) |
| Responsibility | Decides: the credential holder completed the ceremony (UV flag when verified). Yours: recovery, step-up, session |
| Fails when | Presence-only touch counted as MFA; email recovery undoes it |
| Strengths | Phishing-resistant by verifier name binding (NIST SP 800-63B-4) |
| Limits | Synced passkeys qualify up to AAL2, not AAL3 |
| Trust | The authenticator and any sync fabric |
| Verified | Level 3 is a W3C Recommendation, 25 August 2026; the undated URL shows a Level 4 draft, so cite webauthn-3 |
| Docs | WebAuthn Level 3 |
MCP authorization#
Standard (protocol, MCP revision 2026-07-28, read 2026-11-18). OAuth-based authorization for MCP over HTTP: the MCP server is a resource server that publishes Protected Resource Metadata and accepts only tokens issued for itself.
| Field | Detail |
|---|---|
| Solves | An AI client finds the authorization server and gets a token bound to one server |
| Minimum | RFC 9728 metadata, resource on every request, audience check; not run here (MCP) |
| Responsibility | Decides: discovery, audience, scope challenges. Yours: tool, arguments, record, user |
| Fails when | Token passed through upstream ("MUST NOT pass through"); foreign tokens accepted |
| Strengths | Reuses OAuth; scope step-up defined |
| Limits | Authorization is OPTIONAL; stdio SHOULD NOT use it |
| Trust | The authorization servers your metadata lists |
| Verified | Current revision 2026-07-28 |
| Docs | Authorization, depth on mcp.sammuthu.com |
A2A security schemes#
Standard (protocol, A2A specification 1.0.0, read 2026-11-18). An Agent Card declares securitySchemes (API key, HTTP auth, OAuth 2.0, OpenID Connect, mutual TLS); servers authenticate every request.
| Field | Detail |
|---|---|
| Solves | A calling agent learns how to authenticate before sending a task |
| Minimum | Schemes on the card; reject missing credentials; not run here (A2A) |
| Responsibility | Decides: accepted credential types. Yours: authorization, which "MUST occur before any database queries" |
| Fails when | TASK_STATE_AUTH_REQUIRED treated as authorization (forbidden) |
| Strengths | Reuses OAuth, OIDC, mTLS; cards may carry JWS signatures |
| Limits | No signature or replay window for push notifications |
| Trust | The card's origin, or its signature |
| Verified | Specification 1.0.0 |
| Docs | A2A specification, protocol on a2a.sammuthu.com |
Token formats. A format says how to check that a token is genuine; never what its holder may do.
JWT, JWS, JWE and JWK#
Token format (RFC 7519, 7515, 7516, 7517, 7518, read 2026-11-18). A JWT is a set of claims in a JWS (signed or MACed) or JWE (encrypted); a JWK is a key in JSON, a JWK Set publishes several.
| Field | Detail |
|---|---|
| Solves | Local validation without calling the issuer |
| Minimum | A maintained library with fixed algorithms, issuer, audience, expiry; ran here in both library demos (Tokens) |
| Responsibility | Decides: integrity, and for JWE confidentiality. Yours: issuers, audiences, algorithms, claims |
| Fails when | alg: none; algorithm read from the header; aud unchecked |
| Strengths | Self-contained; key rotation by kid |
| Limits | Revocation before exp needs more; signed claims are not secret |
| Trust | Whoever holds the signing key |
| Verified | RFC 7518 updated by RFC 9864: EdDSA deprecated for Ed25519, Ed448. RFC 8725 is the BCP. RFC 9068 access tokens: typ at+jwt; iss, exp, aud, sub, client_id, iat, jti required |
| Docs | RFC 7519, RFC 8725, RFC 9068, RFC 9864 |
Guidelines. Advice with SHALL and SHOULD, but no wire format. Not software, so nothing to host.
NIST SP 800-63-4#
Guideline (Digital Identity Guidelines, read 2026-11-18). Volumes defining assurance levels for proofing (IAL), authentication (AAL) and federation (FAL).
| Field | Detail |
|---|---|
| Solves | A shared answer to "how sure are we about this person?" |
| Minimum | Pick an AAL per user group by risk (Authenticators) |
| Responsibility | Decides: what each level requires. Yours: choosing and enforcing it |
| Fails when | Old 63-3 rules kept; email used for out-of-band authentication ("SHALL NOT") |
| Strengths | Concrete SHALL statements, risk-based tailoring |
| Limits | Written for government services; no record-level authorization |
| Trust | Your own conformance claim |
| Verified | Final, July 2025, supersedes 63-3; single-factor passwords at least 15 characters; AAL2 SHALL offer a phishing-resistant option |
| Docs | SP 800-63-4 |
NIST SP 800-207#
Guideline (Zero Trust Architecture, read 2026-11-18). Seven tenets and a model in which a subject reaches a resource through a PDP and PEP, with no implicit trust from network location.
| Field | Detail |
|---|---|
| Solves | "Inside the network" treated as trusted |
| Minimum | Per-request authentication and authorization at a PEP (Gateways and zero trust) |
| Responsibility | Decides: vocabulary (policy engine, policy administrator, PEP). Yours: every control |
| Fails when | A "zero trust" product bought, the flat network kept |
| Strengths | Technology-agnostic |
| Limits | Not for anonymous consumer processes; no business authorization |
| Trust | Not applicable |
| Verified | Final, August 2020; no withdrawal notice |
| Docs | SP 800-207 |
OWASP cheat sheets and API Security Top 10#
Guideline (OWASP, read 2026-11-18). Community guidance on common weaknesses; the 2023 API list puts Broken Object Level Authorization first.
| Field | Detail |
|---|---|
| Solves | Repeated mistakes, named with fixes |
| Minimum | API1 (BOLA) and API5 (BFLA) as negative tests (Threat testing) |
| Responsibility | Decides: nothing; advises "Deny by Default". Yours: all of it |
| Fails when | Citing moved pages; the Java JWT sheet now returns 404 |
| Strengths | Headings that turn into tests |
| Limits | Living pages without versions: the read date is the version |
| Trust | Not applicable |
| Verified | API pages moved to api-security.owasp.org. Microservices sheet: "Gateway checks complement these controls; they do not establish that a downstream operation is authorized." |
| Docs | Cheat sheets, API Top 10 2023 |
RFC 9700 (OAuth Security BCP)#
Standard (best current practice, BCP 240, read 2026-11-18). IETF security advice updating RFC 6749, 6750 and 6819.
| Field | Detail |
|---|---|
| Solves | OAuth built on 2012 assumptions |
| Minimum | Exact redirect matching; PKCE with S256; no implicit or password grant |
| Responsibility | Decides: MUST and SHOULD for servers and clients. Yours: audience and minimal scopes per token |
| Fails when | A password grant kept "for one client" ("MUST NOT be used") |
| Strengths | One current rule list |
| Limits | OAuth only |
| Trust | Not applicable |
| Verified | January 2025; RFC 10017 (August 2026) ranks browser patterns, BFF first |
| Docs | RFC 9700, RFC 10017 |
Libraries and frameworks. Code in your own process. They make validation correct where configured; they cannot know your records.
Spring Security#
Library (Java, Spring Security 7.1.2, ran here). Spring's security framework: a filter chain, an OAuth 2.0 resource server for JWTs, and method security through AuthorizationManager.
| Field | Detail |
|---|---|
| Solves | Standard authentication and authorization in Spring apps |
| Minimum | Ran here: examples/frameworks/spring-security/, 17 tests, 0 failures, Spring Boot 4.1.2 |
| Responsibility | Decides: signature, iss, exp, nbf, scope authorities, @PreAuthorize. Yours: the UwAuthz bean, assignments, a 401 step-up |
| Fails when | aud is not validated by default; jwt() tests skip the decoder |
| Strengths | RS256-only default; denied reads become 404 via @HandleAuthorizationDenied |
| Limits | Method security off until @EnableMethodSecurity |
| Trust | In-process; the configured issuer keys |
| Verified | 7.1.2 reference; clock skew 60 s |
| Docs | Resource server JWT, Method security |
The audience check the demo had to add, verbatim from SecurityConfig.java (jwtDecoder), compiled and run by Maven:
OAuth2TokenValidator<Jwt> audience =
new JwtClaimValidator<List<String>>(JwtClaimNames.AUD, aud -> aud != null && aud.contains(AUDIENCE));
decoder.setJwtValidator(new DelegatingOAuth2TokenValidator<>(JwtValidators.createDefaultWithIssuer(ISSUER), audience));
FastAPI and PyJWT#
Library (Python: FastAPI 0.165.0, PyJWT 2.15.1, ran here). FastAPI's security helpers are dependencies; PyJWT validates JWTs.
| Field | Detail |
|---|---|
| Solves | Token validation as a reusable dependency |
| Minimum | Ran here: examples/frameworks/fastapi-jwt/, 19 passed, ES256 |
| Responsibility | Decides: signature, algorithm list, iss, aud, exp, required claims. Yours: tenant, unit, assignment, acr, 404 or 403 |
| Fails when | Copying the tutorial: it checks neither aud nor iss |
| Strengths | Explicit algorithms; one exception per failure |
| Limits | options.require checks presence only |
| Trust | In-process |
| Verified | Tutorial uses PyJWT and pwdlib (Argon2), not python-jose |
| Docs | FastAPI OAuth2 with JWT, PyJWT API |
The demo's decode call, from app.py (current_subject), dedented, and lines of its real output:
claims = jwt.decode(
creds.credentials,
public_key,
algorithms=ALGORITHMS,
audience=AUDIENCE,
issuer=ISSUER,
options={"require": ["exp", "iss", "aud", "sub"]},
)
test_app.py::test_alg_mismatch_rs256_401 PASSED
test_app.py::test_alg_none_401 PASSED
test_app.py::test_other_tenant_and_missing_look_the_same PASSED
test_app.py::test_peer_underwriter_403 PASSED
test_app.py::test_agent_with_uw_decide_scope_403 PASSED
======================== 19 passed, 1 warning in 0.34s =========================
Next.js BFF pattern#
Pattern with a library (Next.js, documented shape; not run here). The backend for frontend keeps tokens on the server and gives the browser a session cookie; Next.js documents a Data Access Layer that checks the session next to the data.
| Field | Detail |
|---|---|
| Solves | Tokens stolen from browser JavaScript |
| Minimum | HttpOnly, Secure, SameSite cookie; verifySession() in a Data Access Layer; checks in each Server Action (Sessions) |
| Responsibility | Decides: where the session lives. Yours: every check near the data |
| Fails when | Proxy is the only check; a skipped matcher path also skips its Server Functions |
| Strengths | RFC 10017 ranks BFF the most secure browser pattern |
| Limits | Proxy is for optimistic checks only |
| Trust | Server holds tokens; browser holds a cookie |
| Verified | Next.js 16 renamed middleware to proxy; no current release number on the pages read |
| Docs | Authentication guide, Proxy |
Auth.js#
Library (JavaScript, read 2026-11-18). An authentication library, formerly NextAuth.js.
| Field | Detail |
|---|---|
| Solves | Sign-in from a library instead of hand-written flows |
| Minimum | Documented shape; not run here |
| Responsibility | Decides: sign-in and sessions. Yours: all authorization |
| Fails when | A new project starts on it without knowing its status |
| Strengths | Security patches continue |
| Limits | Maintainer changed (next row) |
| Trust | In-process |
| Verified | authjs.dev: "now part of Better Auth"; the Better Auth blog (22 September 2025) recommends Better Auth for new projects |
| Docs | authjs.dev, Better Auth post |
What this is not. This page does not compare policy code line by line. Policy as code writes the same rule in six engines that ran, with tests and decision logs.
Identity providers (products). They authenticate principals and issue OAuth and OIDC tokens. None knows that SUB-1004 is assigned to u-uw-w1 unless you put it there. Capability facts as documented on 2026-11-18.
Keycloak#
Product (open-source identity provider, 26.8.2). A server you host that manages realms of users, clients, roles and groups and issues OIDC and SAML tokens.
| Field | Detail |
|---|---|
| Solves | A self-hosted identity provider with federation |
| Minimum | A realm per environment, a client per app; not run here |
| Responsibility | Decides: login, realm and client roles, token contents. Yours: record checks, unless you adopt its Authorization Services |
| Fails when | Legacy token exchange V1 enabled ("a very loose implementation") |
| Strengths | Brokering to OIDC or SAML providers; LDAP and Active Directory federation; RFC 8693 exchange on by default |
| Limits | Standard exchange works within one realm only |
| Trust | You run, patch and guard its signing keys |
| Verified | Admin guide 26.8.2; Authorization Services: central PDP, default strategy "Unanimous" |
| Docs | Server admin, Token exchange |
Okta#
Product (hosted identity provider). A service whose authorization servers issue OAuth 2.0 and OIDC tokens.
| Field | Detail |
|---|---|
| Solves | A hosted provider that protects your own APIs |
| Minimum | A custom authorization server per API; not run here |
| Responsibility | Decides: scopes, claims, access policies per custom server. Yours: record decisions |
| Fails when | The built-in org server is used for your API: its audience, claims, policies and scopes cannot be customized |
| Strengths | Custom servers define their own scopes, claims and policies |
| Limits | The default custom server has no access policy until you add one |
| Trust | The vendor's keys and availability |
| Verified | No product version on the page read |
| Docs | Authorization servers |
Auth0#
Product (hosted identity provider). A service organized in tenants holding applications, connections and user profiles.
| Field | Detail |
|---|---|
| Solves | Login for your applications, including business customers |
| Minimum | A tenant per environment; Organizations for B2B; not run here |
| Responsibility | Decides: login, per-organization connections, member roles. Yours: which brokerage's quote a member reads |
| Fails when | Organization membership treated as record access |
| Strengths | Users can belong to several organizations |
| Limits | The overview read does not describe token claims |
| Trust | Vendor-hosted; region in the tenant domain |
| Verified | No product version on the pages read |
| Docs | Organizations, Tenants |
Microsoft Entra ID#
Product (hosted identity provider). Microsoft's identity platform: app registrations, tokens with scp and roles, on-behalf-of exchange, Conditional Access.
| Field | Detail |
|---|---|
| Solves | Tokens for users and apps in an Entra tenant |
| Minimum | App roles for stable categories; check aud, scp or roles; not run here |
| Responsibility | Decides: delegated scopes, app roles, Conditional Access. Yours: Entra says "Keep finer-grained resource permissions in your application's authorization data" |
| Fails when | Authorizing on mutable preferred_username; no groups claim above 200 groups |
| Strengths | Immutable oid; OBO keeps the user downstream |
| Limits | OBO only for user principals; Conditional Access after the first factor |
| Trust | Vendor-hosted; combine tid with other claims |
| Verified | No product version on the pages read |
| Docs | Access token claims, App roles |
Amazon Cognito#
Product (hosted identity provider). User pools authenticate and issue JWTs; identity pools exchange tokens for temporary AWS credentials; "Neither component requires the other."
| Field | Detail |
|---|---|
| Solves | App sign-in, and AWS credentials for those users |
| Minimum | A user pool with a resource server and custom scopes; not run here |
| Responsibility | Decides: who the user is; machine tokens carry custom scopes only. Yours: signature and expiry checks ("must verify"), record decisions |
| Fails when | Expecting aud binding on machine tokens: not for client credentials |
| Strengths | Login and AWS credentials in one service |
| Limits | One resource per binding request |
| Trust | Vendor-hosted in your AWS account |
| Verified | No product version on the pages read |
| Docs | What is Cognito, Resource servers |
Cloud identity (products). Which workload may call which cloud API. None knows your quotes. As documented on 2026-11-18.
AWS IAM and STS#
Product (cloud identity). A role has a trust policy (who may assume it) and a permissions policy (what it may do); STS returns temporary credentials.
| Field | Detail |
|---|---|
| Solves | Workloads reach AWS without long-term keys |
| Minimum | A role per workload; AssumeRoleWithWebIdentity from outside AWS (Cloud IAM) |
| Responsibility | Decides: AWS actions on AWS resources. Yours: your application's data |
| Fails when | Long-term access keys; IMDSv1 left on (both allowed by default) |
| Strengths | Session policies only narrow; SCPs and boundaries grant nothing |
| Limits | Role chaining caps a session at one hour |
| Trust | AWS and every identity provider a role trusts |
| Verified | AWS prefers "temporary credentials instead of creating long-term credentials" |
| Docs | IAM best practices, AssumeRole |
Google Cloud IAM and Workload Identity Federation#
Product (cloud identity). Service accounts and roles, plus federation that exchanges an external token for a Google token through the Security Token Service.
| Field | Detail |
|---|---|
| Solves | Outside workloads use Google Cloud without service account keys |
| Minimum | A pool, a provider, an attribute condition; not run here |
| Responsibility | Decides: which external identity maps to which principal. Yours: your authorization |
| Fails when | No attribute condition on a shared issuer (GitHub, GitLab SaaS, HCP Terraform) |
| Strengths | Key creation off by default for organizations created from 3 May 2024 |
| Limits | Leaked-key detection is best-effort |
| Trust | Google and the external issuer |
| Verified | Docs moved to docs.cloud.google.com (301) |
| Docs | Workload Identity Federation, Service account keys |
In a coding agent. The coding agent's CI job reaches the cloud through OIDC federation, not stored keys. GitHub documents an immutable defaultsubfor repositories created after 15 July 2026 (repo:OWNER@OWNER-ID/REPO@REPO-ID:...), so a renamed repository cannot inherit cloud access. The trust condition decides which job gets a role, never what the agent's pull request may change. See Coding agents.
Azure managed identities#
Product (cloud identity). Entra service principals tied to an Azure resource (system-assigned) or standalone (user-assigned) that get tokens without secrets.
| Field | Detail |
|---|---|
| Solves | Azure workloads call Entra-protected APIs without stored credentials |
| Minimum | A user-assigned identity; MSAL or Azure.Identity; not run here |
| Responsibility | Decides: which workload gets a token. Yours: what it may do to records |
| Fails when | One identity shared by unrelated workloads |
| Strengths | "doesn't require any secrets" |
| Limits | Federated credentials match issuer, subject, audience case-sensitively |
| Trust | Entra and any federated issuer |
| Verified | User-assigned is Microsoft's recommended type |
| Docs | Managed identities, Workload identity federation |
API gateway authorizers#
Product (gateway features). Gateways validate tokens before your service: AWS API Gateway JWT and Lambda authorizers, Azure API Management validate-jwt, Google Cloud API Gateway.
| Field | Detail |
|---|---|
| Solves | Unauthenticated traffic stopped at the edge |
| Minimum | Issuer, audience, keys per API; not run here (Enforcement) |
| Responsibility | Decides: token validity, at most a scope or claim per route. Yours: the object check that stops BOLA |
| Fails when | AWS: ID and access tokens look alike, so require scopes. A cached Lambda policy must fit "all resources and methods" |
| Strengths | AWS JWT authorizer checks kid, iss, aud, exp, nbf, iat, scopes. Azure requires signature and exp by default; fails with 401 |
| Limits | AWS JWT authorizer: RSA only, keys cached up to two hours. Azure: the audiences element is marked not required (its description says at least one audience must be specified when used); clock-skew defaults to 0 |
| Trust | Services trust forwarded claims (Google: X-Apigateway-Api-Userinfo) and must refuse bypass traffic |
| Verified | Google: "you don't have to add any code in your API to process the authentication" (authentication only) |
| Docs | AWS JWT, AWS Lambda, Azure, Google |
Policy engines. They evaluate your rule on facts you send; none authenticates the caller. Code side by side: Policy as code.
OPA and Rego#
Engine (Open Policy Agent 1.22.4, ran here). A general-purpose engine that evaluates Rego policies against JSON input and data.
| Field | Detail |
|---|---|
| Solves | One engine "across the stack"; enforcing code holds no policy |
| Minimum | Ran here: examples/frameworks/opa/, opa test 10/10 PASS |
| Responsibility | Decides: the decision document you design. Yours: token validation, the record, assignment as input, enforcement |
| Fails when | A fact is missing: OPA cannot know an assignment you did not send |
| Strengths | Signed bundles; decision logs with masking |
| Limits | Rego is one more language for the team to learn and review |
| Trust | Its bundle source |
| Verified | v1.22.4, 12 November 2026; Rego v1 default; CNCF Graduated |
| Docs | OPA docs, Releases |
Cedar#
Engine (Cedar, via cedarpy 4.12.2, ran here). permit and forbid policies over typed entities, validated against a schema.
| Field | Detail |
|---|---|
| Solves | Readable policies with default deny |
| Minimum | Ran here: examples/frameworks/cedar/, 9/9 answers as expected |
| Responsibility | Decides: Allow or Deny; forbid overrides permit. Yours: entities from your data, context, Deny to 404, 403 or step-up |
| Fails when | A policy with an evaluation error is skipped |
| Strengths | Validation caught an attribute typo before any request |
| Limits | Versions differ by source (next row) |
| Trust | In-process, or Amazon Verified Permissions as hosted PDP |
| Verified | Reference guide: Cedar 4.6; Verified Permissions: Cedar 4.12; cedarpy 4.12.2 maps to engine 4.12.0 |
| Docs | Cedar docs, Verified Permissions |
OpenFGA#
Engine (relationship-based, OpenFGA v1.22.1, ran here). A Zanzibar-style engine that stores relationship tuples and answers Check: does this user have this relation to this object?
| Field | Detail |
|---|---|
| Solves | Membership, assignment, hierarchy (ReBAC) |
| Minimum | Ran here: examples/frameworks/openfga/, 8/8 Checks as expected |
| Responsibility | Decides: allowed from tuples and conditions. Yours: writing and deleting tuples, passing acr |
| Fails when | Missing condition context returned HTTP 400, not allowed: false: treat errors as deny |
| Strengths | Type restrictions refused an agent tuple at write time |
| Limits | Defaults are for trying it: --authn-method none, datastore memory |
| Trust | You run it; its API holds every relationship |
| Verified | CNCF incubating; conditions in CEL |
| Docs | Concepts, Conditions |
PostgreSQL row-level security#
Product (database feature, PostgreSQL 18.7, ran here). Table policies that filter which rows a database role may read or write; no policy means deny.
| Field | Detail |
|---|---|
| Solves | A forgotten WHERE tenant = ? no longer leaks rows |
| Minimum | Ran here: examples/frameworks/postgres-rls/, six steps as expected (Tenants) |
| Responsibility | Decides: row visibility, WITH CHECK on writes. Yours: the tenant per transaction from the verified token |
| Fails when | Owner without FORCE ROW LEVEL SECURITY; superusers and BYPASSRLS always bypass |
| Strengths | Last line of defense under every query |
| Limits | Not the API's authorization |
| Trust | The session variable your app sets |
| Verified | Current docs: PostgreSQL 18 |
| Docs | Row security policies |
AuthZEN Authorization API 1.0#
Standard (API, OpenID AuthZEN, read 2026-11-18). A standard PEP-to-PDP exchange: subject, action, resource, optional context in; boolean decision out.
| Field | Detail |
|---|---|
| Solves | Every PDP speaking its own format |
| Minimum | /access/v1/evaluation; metadata at /.well-known/authzen-configuration; not run here |
| Responsibility | Decides: the wire shape. Yours: the policy and the facts |
| Fails when | Two AuthZEN PDPs assumed to decide alike |
| Strengths | Swap PDPs without rewriting PEPs |
| Limits | No policy language |
| Trust | The PDP you call |
| Verified | Final, 11 January 2026 |
| Docs | Authorization API 1.0 |
Workload identity. A standard for naming workloads, and a product that issues their credentials.
SPIFFE and SPIRE#
Standard and product (SPIFFE; SPIRE v1.16.0, read 2026-11-18). SPIFFE gives each workload an ID such as spiffe://insurer.example/ns/uw/sa/underwriting-agent in an X.509-SVID or JWT-SVID; SPIRE attests workloads and issues SVIDs.
| Field | Detail |
|---|---|
| Solves | Services prove identity without shipped secrets |
| Minimum | SPIRE server and agents; X.509-SVIDs for mTLS; not run here (Workload identity) |
| Responsibility | Decides: which workload holds which ID. Yours: the receiver's allowlist or policy |
| Fails when | Many-audience JWT-SVIDs (replayable); x-app-id trusted instead |
| Strengths | No secret in the workload; federation across trust domains |
| Limits | No page read says an ID authorizes anything |
| Trust | The SPIRE server as CA and its attestors |
| Verified | SPIRE v1.16.0 (5 November 2026); CNCF Graduated |
| Docs | SPIFFE concepts, SPIRE releases |
Which kind of thing answers which question#
The five questions of this site do not map one-to-one to products. In one quote read, each kind acts once, and only the service and the engine see the quote's tenant.
Diagram: One quote read · which kind of thing acts at each step
Time runs down the page. The identity provider, a product, issues a token by OAuth and OIDC, which are standards. The gateway authorizer, a product feature, checks the token coarsely. The quote service validates it again with a library and asks a policy engine about the record, sending facts only it knows. The database applies row-level security beneath the query. Only the service and the engine ever see Q-6620's tenant; that is where the broker's cross-tenant read is refused.
- Broker portal BFF to IdP (product): authorization code + PKCE. The standard flow for a person; the product runs it.
- IdP (product) to Broker portal BFF: access token (JWT). A signed token: proves who and for which audience, not which quote.
- Broker portal BFF to Gateway authorizer: GET Q-6620 with bearer token. The broker asks for another brokerage's quote.
- Gateway authorizer to Quote service + library: token valid, scope ok: forward. Coarse check passes; the gateway cannot see the quote's tenant.
- Quote service + library to Policy engine: subject brk-north, resource tenant brk-south. The service sends facts from the verified token and the loaded record.
- Policy engine to Quote service + library: deny: other tenant. The engine decides on the facts it was given.
- Quote service + library to Broker portal BFF: 404 not found. Your code chooses 404 so the quote's existence is not revealed.
Check a design slide against this table: each question needs a named answer, and the authorization row always names your code.
| Question | Answered by | Examples | Never by |
|---|---|---|---|
| Identification | protocol + identity provider | OIDC sub, client_id, SPIFFE ID | a caller-set header |
| Authentication | protocol + library + guideline | WebAuthn, mTLS, JWT validation, AAL | a token format alone |
| Authorization | your code, often with an engine | OPA, Cedar, OpenFGA, a @PreAuthorize bean | an IdP, a gateway, a scope |
| Enforcement | library + database + gateway | filter chain, RLS, a PEP per service | a guideline |
| Audit | your code + engine logs | OPA decision logs, audit records | token claims |
Security notes#
- Defaults are starting points: Spring skips
aud, OpenFGA ships without authentication, PostgreSQL owners bypass RLS. - Several facts here changed in 2026 (RFC 9846, WebAuthn Level 3, Next.js
proxy, SCIM updates): pin and record versions. - Turn engine errors into deny in the PEP. Never take the accepted algorithm from the token header (RFC 8725).
Monday checklist#
- Rewrite your architecture slide with the kind of each name.
- For each library or gateway that validates tokens, confirm
audandissare checked in code. - Keep at least one test that signs a real token, beside any mock-token tests.
- For each policy engine, write the PEP line that turns an error into deny.
- Replace undated citations (the WebAuthn URL) with dated ones.
- Name the file where the record-level rule lives.
Exercises#
Exercise 1. A slide says "Authorization: Entra ID app roles." Brokers have role Broker. What question is left open, and where does Entra's own documentation say to answer it?
AnswerWhich quote: in the application's own data
Broker says the person may read quotes in general, not that u-broker-n1 may read Q-6620. Entra's app-role guidance says to keep finer-grained resource permissions in the application's authorization data and enforce them in the application: the quote service checks the tenant on the record.
Exercise 2. The team adds an AWS HTTP API JWT authorizer with issuer and audience. Which token could still pass that the quote API should refuse, and what does AWS recommend?
AnswerAn ID token with the right audience; require scopes
AWS notes there is no standard way to tell access tokens from ID tokens, so an ID token with a matching aud or client_id may pass. AWS recommends requiring authorization scopes on routes. RFC 9068's typ at+jwt check in the service is a further guard where your identity provider issues that profile.
Exercise 3. A colleague says "we are on OAuth 2.1". What do you check?
AnswerIt is a draft; check the practices, not the label
OAuth 2.1 is still an Internet-Draft (-17 on 2026-11-18). Ask what they implement: PKCE on every authorization code flow, exact redirect URI matching, no implicit or password grant. Those are RFC 9700 requirements today, whatever the label.
Advanced perspective#
A product default is not a designFour defaults from this page that a review must catch
Every default is the vendor's guess about the common case, and none was made for your records. Spring Security's resource server validates iss, exp and nbf but not aud, so a token issued for the assessment service is accepted by the quote API unless someone adds a validator. OpenFGA's run command starts with --authn-method none and an in-memory datastore, which is right for a laptop and wrong for anything reachable. PostgreSQL applies RLS to every role except the table owner, superusers and BYPASSRLS roles; an application that connects as the owner sees every row. Okta's default custom authorization server has no access policy until you write one. The review question is the same each time: what does this product do when nobody configures it, and does that match the design doc? Write the answer next to the configuration, with the documentation URL and the date read, so the next upgrade can be checked against it.
Standards move: how to re-verifyStatus banners, version history, and the undated URL trap
In the year before this page was written, TLS 1.3 got a new RFC number, WebAuthn Level 3 became a Recommendation while its undated URL moved on to a Level 4 draft, SCIM gained two updating RFCs, RFC 7518 was updated to deprecate EdDSA, Next.js renamed middleware, and Auth.js changed maintainers. None of this broke running systems, but each makes a citation wrong. Re-verify from the authority's own status line: the RFC Editor "Obsoleted by" and "Updated by" banners, the W3C history page, the datatracker revision list for drafts, a product's version history or release page. Cite dated URLs (webauthn-3, a numbered draft) instead of "latest". Record claim, URL, date and label in a log, as this site does, and have a second reader re-fetch anything surprising. Cloud documentation also moves host (Google Cloud to docs.cloud.google.com, OWASP API pages to api-security.owasp.org), so a 404 is a reason to search, not a reason to conclude the feature is gone.
Where libraries silently skip checksAudience, test helpers, presence-only claims
Three quiet gaps showed up in the runs. First, audience: Spring does not check aud by default, and the FastAPI tutorial validates neither aud nor iss; the demos add both, and their wrong-audience tests prove it. Second, test helpers: Spring's SecurityMockMvcRequestPostProcessors.jwt() builds a mock Jwt and passes it through the authentication APIs without running the JwtDecoder. The Spring demo has a test named jwtPostProcessor_skipsTheDecoder_soWrongAudienceStillPasses: a token with the wrong audience got 200. That is fine for authorization tests and dangerous if it is your only token test; keep at least one test that signs a real token and expects 401. Third, presence versus validity: PyJWT's options.require checks that claims exist, not what they contain, so a present aud still needs the audience argument. In each case the library behaves as documented. The gap is between what the documentation says and what the team assumed.
A standard between PEP and PDPWhat AuthZEN fixes, and what it leaves to you
Before AuthZEN, moving from one PDP to another meant rewriting every enforcement point, because each engine had its own request shape. The Authorization API 1.0 (Final, 11 January 2026) fixes the question: subject, action, resource, optional context, and a boolean decision. It does not fix the policy language, the facts each PDP needs, or what happens on an error. Two PDPs behind the same API can still disagree about the peer underwriter if one lacks the assignment fact. The useful design is an internal PEP library that speaks AuthZEN, fills the request from validated claims and the loaded record, treats any non-200 answer as deny, and records the PDP's policy version in the audit record. That keeps the swap cheap without pretending the engines are interchangeable.
In one breath#
OAuth is a protocol, JWT a token format, NIST and OWASP guidelines, Spring Security and PyJWT libraries, Keycloak and Entra products, OPA, Cedar and OpenFGA engines, and the BFF a pattern; a design names each by its kind. Every one of them answers a part of identification, authentication or enforcement, and none of them knows that SUB-1004 is assigned to u-uw-w1. The record-level decision stays in your code, with or without an engine. Defaults and versions move, so each claim carries its URL and the date it was read.
You can now name every part of a design slide. Playbooks puts the parts together: for a script, a public SaaS, a B2B multi-tenant SaaS, a private enterprise, an event platform and an autonomous agent, the simplest credible design, the trigger to grow it, and the checklist before production.