Skip to content
Free lab

Authentication Method Lab

The hard part of authentication is not the crypto — it is choosing the right method for the system in front of you. A public API, a single-page app, a mobile client, two backend services, enterprise SSO, a webhook, a legacy intranet tool, a headless CLI — each has one answer that fits and several that quietly do not. Read each brief, weigh the constraints, and pick from API key, Basic, Bearer, JWT, OAuth 2.0, OIDC, mTLS, HMAC, session cookie or SAML. Then see why the right one is right — and why your pick was wrong.

The real job. More noise, a tighter clock.

0sPro

Design brief

For each system, pick the best authentication method. The deciding facts are in the constraints — read them.

#1 · Public API keys

Public developer REST API

Low risk

Third-party developers (server-side)

You publish a public REST API of non-sensitive reference data (maps, weather, exchange rates). Thousands of developers call it from their own backends. You need to meter usage per plan and cut off abusers.

  • ▸Public, low-sensitivity data — no per-user records
  • ▸Must identify the calling project for quotas, billing and analytics
  • ▸Issued/revoked self-service from a developer dashboard
Best method

#2 · User login & SSO

Internal app suite, own IdP

Medium risk

Employees in the browser

Your company runs a modern suite of internal web apps. You operate your own identity provider. Employees should log in once and move between apps without re-authenticating.

  • ▸You need to authenticate the user (who they are)
  • ▸Single sign-on across several first-party web apps
  • ▸Modern greenfield stack; some apps will get mobile clients later
Best method

#3 · Service-to-service

Two internal services, zero-trust mesh

High risk

Backend service → backend service

Two microservices you own call each other inside a zero-trust network where you assume the network itself is hostile. Each service must cryptographically prove its identity to the other.

  • ▸Machine-to-machine, no user involved
  • ▸Zero-trust: mutual authentication, not just a shared secret
  • ▸You control both ends and can run an internal CA / service mesh
Best method

#4 · Message integrity

Outbound webhooks to customers

High risk

Your server → customers' receiving endpoints

You POST event notifications (payment succeeded, build finished) to URLs your customers register. Each customer must be able to verify a delivery genuinely came from you and was not tampered with or replayed.

  • ▸You are the sender; thousands of independent receivers
  • ▸Receivers must verify authenticity AND payload integrity
  • ▸Must survive a malicious proxy altering the body
Best method

#5 · Browser sessions

Server-rendered web app

Medium risk

Users in the browser, one app

A classic server-rendered web application with its own login form. Pages are rendered by one backend and served to the user's browser. No third parties, no SPA, no mobile.

  • ▸First-party browser app; server renders every page
  • ▸Users log in with their own account to this one app
  • ▸No cross-app SSO required, no API clients
Best method

#6 · User login & SSO

Legacy enterprise SSO integration

High risk

Enterprise employees in the browser

You sell a browser-only web application to large enterprises. Each customer wants employees to sign in through their existing corporate IdP (ADFS / Okta). Their IdP and the rest of their SaaS catalog are standardised on one federation protocol.

  • ▸Browser-only app — no mobile, no public API surface
  • ▸Must consume the customer's existing enterprise IdP
  • ▸That IdP and their other SaaS all speak SAML 2.0
Best method

#7 · Delegated access

Third-party app acting for a user

High risk

External apps accessing your users' data

Independent developers build apps that act on behalf of your users — "export my reports to app X". A user should grant app X scoped access to their data without ever handing over their password, and be able to revoke it.

  • ▸A third party accesses one user's resources with that user's consent
  • ▸Access must be scoped (read reports only) and revocable
  • ▸The user must never share their password with the third party
Best method

#8 · Token validation

Stateless API behind a load balancer

Medium risk

Many API nodes validating a user token

Your API runs as many stateless replicas behind a load balancer and must validate the caller's access token on every request without a round-trip to a central session store or auth server.

  • ▸Horizontally scaled, stateless nodes — no sticky sessions
  • ▸Each node must validate the token locally, offline
  • ▸Token carries the user id, scopes and an expiry
Best method

#9 · Service-to-service

Backend job calls an internal API

High risk

A service (no user) → another service

A nightly batch service needs to call an internal API. There is no user in the loop. You have no shared PKI or service mesh, but you do run an OAuth 2.0 authorization server. You want short-lived, scoped, revocable credentials — not a static secret living forever in config.

  • ▸Machine client, no user; no mutual-TLS / PKI available
  • ▸You already operate an OAuth 2.0 authorization server
  • ▸Want expiring, scoped, centrally-revocable credentials
Best method

#10 · Token validation

Presenting an already-issued token

Medium risk

Mobile app → your API, per request

Your mobile app has already logged the user in via OIDC and holds a short-lived access token. The question is narrowly how the app should present that token to your API on each request.

  • ▸The token already exists (issued by the OIDC flow)
  • ▸Question is only the transport on each API call
  • ▸Standard, cache-friendly, framework-supported
Best method

#11 · Browser sessions

Tiny internal dashboard behind the VPN

Low risk

A few admins in the browser

A read-only internal status dashboard, reachable only over the corporate VPN, used by a handful of ops staff. There is no identity provider and no application framework — it is a single static-ish page behind a reverse proxy. You need the simplest standards-based per-person gate.

  • ▸Internal-only, VPN-gated, very low exposure
  • ▸No IdP, no session framework, no login UI to build
  • ▸Must be a standard the reverse proxy already supports
Best method

Decisions made

Answer each scenario, then grade. So far 0/11 chosen.

The ten methods

API key — Static shared secret identifying the calling app/project. Good for public APIs, quotas and analytics — not a user identity.

HTTP Basic Auth — username:password (base64) sent on every request over TLS. Simple and legacy; a reusable credential on the wire each call.

Bearer token — An already-issued opaque/JWT token presented in Authorization: Bearer. The transport for a token, not a way to obtain one.

JWT (signed token) — Self-contained signed claims verified locally with the issuer key — stateless, no central session lookup per request.

OAuth 2.0 — Delegated authorization: scoped, revocable, expiring access tokens for third parties, machines, and input-constrained devices.

OpenID Connect — An authentication layer on OAuth 2.0 — proves who the user is via an ID token. The modern web/mobile SSO default.

Mutual TLS — Both peers present X.509 certificates. Strong, non-repudiable machine identity with no shared bearer secret to leak.

HMAC request signing — A shared-secret signature over the body + timestamp — authenticity AND integrity per message. Webhooks, AWS SigV4.

Session cookie — A server session keyed by an HttpOnly, Secure, SameSite cookie. The classic first-party browser web-app method.

SAML 2.0 — XML browser-POST federation assertions. The enterprise web-SSO incumbent for browser-only apps behind a corporate IdP.

Live arena

4 active
adversary kill-chain1/4
iam-arch-rao10%
appsec-kim7%
platform-eng-dana4%
iam-arch-you (you)0%

adversary staging…

TL;DR

What this lab is

  • A free, browser-based lab: read a system-design scenario — a public REST API, an SPA, a mobile app, a service-to-service call, enterprise SSO, webhook signing, a legacy intranet, a CLI/device — and pick the best authentication method for it.
  • You choose from the ten real options: API key, HTTP Basic, Bearer token, JWT, OAuth 2.0, OpenID Connect, mutual TLS, HMAC request signing, session cookie, and SAML 2.0.
  • Each scenario has one ground-truth best method. After grading, every scenario explains why the right method fits and why the method you chose is wrong for that case.
  • Three difficulty tiers add subtler scenarios and deliberate traps — a JWT in localStorage, an API key pasted into a CLI, mTLS where a gateway terminates TLS, using raw OAuth 2.0 as a login.
  • Scored on how many scenarios you match to the method actually built for them, with a per-topic breakdown (machine identity, user login, message integrity, browser sessions, delegated access, token validation).

Frequently asked questions

What is the Authentication Method Lab?

A free, in-browser exercise where you are given realistic system-design scenarios — a public API, a single-page app, a mobile app, service-to-service calls, enterprise SSO, webhook delivery, a legacy intranet tool, a CLI or smart-TV device — and you pick the best authentication method for each from API key, Basic Auth, Bearer token, JWT, OAuth 2.0, OpenID Connect, mutual TLS, HMAC signing, session cookie, or SAML. It scores how well you match the method to the client type and the constraints.

How is it graded?

Each scenario has one best-fit method. Your score is the share of scenarios you answer with that method, and the result card breaks your accuracy down by topic — machine identity, user login and SSO, message integrity, browser sessions, delegated access, and token validation — so you can see which family of decisions is weakest. After grading, each scenario shows why the right method fits and why the one you picked does not.

Is there a single correct answer for every case?

Each scenario is written with constraints that make one method the clear best fit, and the debrief names the deciding fact — "no shared secret" points to mutual TLS, "acting on behalf of a user" to OAuth 2.0, "validate locally at scale" to JWT, "body must survive a gateway" to HMAC signing. Where two methods are genuinely close (OIDC vs. SAML, mTLS vs. OAuth 2.0 client credentials) the scenario adds the constraint that decides it, and the explanation says why the runner-up is second.

Who is it for?

Backend and platform engineers, application-security and IAM practitioners, architects, and anyone preparing for a security or system-design interview who wants to reason crisply about when to reach for an API key versus OAuth 2.0 versus mutual TLS versus a session cookie — and why common shortcuts (a token in localStorage, an API key in the client bundle, a password shared with a third party) are wrong. It runs entirely in your browser: no account, no install, nothing sent anywhere.

🎉 New here? Use code WELCOME10 for 10% off any plan at checkout
Authentication Method Lab — Pick the Right Auth for Each System · PlayCISO