Lion Cipher Lab

Create users the moment they sign in: Just-in-Time provisioning with Keycloak identity brokering

Why it matters

When you federate an application to an external identity provider, a brand-new person has no account in that application the very first time they sign in — so something has to create one. There are only two ways to do it, and knowing which to reach for is a real, interview-grade judgement. PUSH provisioning (SCIM) has the identity provider create accounts in the app AHEAD of time, and — crucially — deactivate them when the person leaves. PULL provisioning, better known as Just-in-Time or JIT, has the application create the account ON THE FLY at first successful login, reading the person's…

What you'll learn

Steps in this lab

  1. From zero: the first-login problem, and the two ways to solve it
  2. What you are about to build, and why it is two realms
  3. Start Keycloak in Docker
  4. Build the upstream IdP: a realm, a user, and a group to map later
  5. Register the broker as an OIDC client of the upstream IdP
  6. Find the discovery URL — the one link that wires two realms together
  7. In the broker realm: add the upstream IdP and set the Sync Mode
  8. Add a mapper so an upstream group becomes a broker role
  9. The moment: log in as a fresh user and watch the account appear
  10. Sync Mode in action: change the upstream profile, log in again
  11. The deprovisioning trap: remove the upstream user, watch the orphan remain
  12. SCIM (push) vs JIT (pull) — which, and when
  13. The pro move: how real deployments actually combine them
  14. Clean up — and what is left on your machine (nothing)

Open the full interactive lab →