Lion Cipher Lab

Put SSO in front of an app that has no login — oauth2-proxy and Keycloak

Why it matters

Every organization has that one internal app -- an old dashboard, a metrics page, a wiki, an admin panel -- that has no real login of its own and was only ever 'protected' by being on the internal network. The moment anyone can reach it, anyone is in. Rewriting the app to speak OpenID Connect is often impossible: no source, no maintainer, no budget. oauth2-proxy is the standard, free answer to exactly this problem. It is an authenticating reverse proxy: you place it in front of the app, point it at an identity provider (here, the Keycloak realm you built in the prerequisite lab), and now…

What you'll learn

Steps in this lab

  1. The problem, and what oauth2-proxy is
  2. The words you need: upstream, issuer URL, redirect URI, client secret, cookie secret
  3. BEFORE: run a no-auth app and prove anyone can reach it
  4. Register an OIDC client for the proxy in Keycloak
  5. Generate a proper random cookie secret
  6. Start oauth2-proxy in front of the app
  7. AFTER: measure the redirect, then log in and read the injected identity
  8. Tighten who is allowed in: from any-logged-in-user to an allowlist
  9. The honest negative: authN at the edge is not authZ inside the app

Open the full interactive lab →