Lion Cipher Lab

Require stronger auth for sensitive actions: step-up authentication with Keycloak

Why it matters

Not every action deserves the same level of trust. Reading your balance is low-stakes; wiring the balance to a stranger is not. Yet most apps authenticate you once at the door and treat that single login as a blanket permission for everything you do all session — so a stolen session cookie or an unlocked laptop becomes a transfer, a deletion, or an admin change. Step-up authentication fixes this: it demands stronger or fresher proof at the moment of a high-value action, not just at login. This is how banks re-prompt before a transfer and how cloud consoles re-ask before you delete production.…

What you'll learn

Steps in this lab

  1. What step-up authentication is — and the problem it solves
  2. acr and amr: the claims that carry 'how strongly did they log in'
  3. Start a real authorization server: Keycloak in Docker
  4. Create a realm, a user, and a public client
  5. Map acr values to Levels of Authentication (LoA)
  6. Build the step-up flow: a conditional OTP subflow at LoA 2
  7. Log in normally and confirm acr = 1
  8. Demand a higher level and watch Keycloak step up
  9. Freshness, not just strength: what max_age forces
  10. The half everyone forgets: the CLIENT must verify acr (RFC 9470)
  11. When, why, and the better factor — using step-up well

Open the full interactive lab →