Production realm browser login proof
Release evidence for signing in to the production realm through a real browser. The console
(/) and the floor app (/m/) were each proved once on a disposable local stack: the login sent
the exact registered callback, Keycloak answered on that callback, and the protected deep link
the person asked for was on screen afterwards. Nothing on Atlas, the public demo, Cloudflare or
DNS was touched.
What was verified
| Date | 2026-10-17 (UTC) |
| Code | branch fm/karyo-prod-realm-browser-login-proof on top of commit e9d5fa7134566e6c3ba6ce34852f56014ac14181 (main). The defect fixes listed below are in the same change as this record |
| Identity provider | the managed Keycloak 26.8.0 container of the prod-profile Compose stack, karyo-realm-prod.json imported on a fresh database |
| Stack | scripts/deploy-server.sh --reset-db with COMPOSE_PROJECT_NAME=karyo-loginproof NGINX_HTTP_PORT=18512 and its own image tags. A local nginx with a self-signed certificate in front gave the HTTPS origin https://localhost:18543; the application refuses an HTTP issuer outside loopback development and test |
| People | the four ephemeral E2E personas scripts/run-e2e.sh provisions in Keycloak and KARYO_E2E_IDENTITY_BOOTSTRAP=true enrolls on top of System. They exist only for the run and global teardown deletes them; nothing in the realm file ships a human user |
| Browser | Playwright 1.58.2 Chromium (build 1208), ignoreHTTPSErrors and --ignore-certificate-errors for the self-signed certificate only |
| Result | auth.spec.ts: 6 passed, 0 failed, 0 skipped, three times in a row, each on a fresh database |
The run used a local wrapper Playwright config that imports tests/e2e/playwright.config.ts
and adds only the certificate options and an output directory outside the repository:
BASE_URL=https://localhost:18543 CURL_CA_BUNDLE=<cert> NODE_EXTRA_CA_CERTS=<cert> \
KARYO_E2E_IDENTITY_BOOTSTRAP=true KARYO_PG_CONTAINER=karyo-loginproof_postgresql_1 \
./scripts/run-e2e.sh --config=<wrapper config> auth.spec.ts
CURL_CA_BUNDLE matters: without it the runner's reachability probe cannot verify the
certificate, takes the stack for absent and tries to start one under the default Compose project.
The callbacks
auth.spec.ts now records every top-level navigation and asserts, for each interactive login,
that the authorization request carried exactly <origin>/ or <origin>/m/ as redirect_uri and
that Keycloak redirected back to exactly that document with a code for the same state. The
traces of the last of the three passing runs show these top-level round trips (states shortened):
| Test | Authorization redirect_uri |
Callback document | Deep link on screen afterwards |
|---|---|---|---|
| Console, first login | https://localhost:18543/ |
https://localhost:18543/?state=5d97…&code=… |
/inventory?scope=all#initial-login |
| Console, after the session expired | https://localhost:18543/ |
https://localhost:18543/?state=e677…&code=… |
/inventory?scope=all#session-expired |
| Floor, first login | https://localhost:18543/m/ |
https://localhost:18543/m/?state=136f…&code=… |
/m/inquiry?mode=scan#lookup |
| Floor, after signing out | https://localhost:18543/m/ |
https://localhost:18543/m/?state=ffed…&code=… |
/m/inquiry?mode=rescan#reauthenticated |
The silent session checks ran in their iframes against /silent-callback and
/m/silent-callback, the other two registered callbacks. The realm registers no wildcard, so a
login that sent any other redirect_uri would have been refused by Keycloak before the form.
On a fresh production install there is no Business Unit, so the operator persona has no
operational context and the restored console deep link shows Inventory's permission state, not
stock. The test asserts the Inventory route itself (data-testid="inventory-page"), which both
states render; the floor deep link shows the INQUIRY screen.
Defects found and fixed in the same change
- Every provisioned live run stopped in global setup. Global setup and teardown swept
e2e-agent-OAuth clients, but the production realm grants thekaryo-adminservice account onlymanage-usersandview-realm, so the client lookup was refused with 403 before any test ran. The sweep now lives only in the Approvals spec, which registers and removes that client itself.fixtures/global-hooks.test.tsruns the real hooks against a Keycloak that refuses client administration; it failed withKeycloak agent client lookup 403before the fix. - The console's Inventory page sent a request its caller could not make. It loaded
fix-assignments, which need
layout.read, for every caller, so the permission state showed a "Could not load fix assignments" error toast. The request now waits forinventory.readandlayout.read. - The silent sign-in iframe started a login of its own. The console's entry point treated
the iframe at
/silent-callbacklike a page visit and began a login there, which logged[OIDC] Init failed: TypeError: Failed to fetchwhen the page removed the iframe, and which could overwrite the page's saved deep link in the session storage they share. The entry point now stops once the silent callback has handed its response back. - The console reauthentication step waited on a timer. After the console fix above, nothing on the permission state sent a request, and the test reached the login form only through the console's 30-second session check, about one second before its own timeout. The test now installs Playwright's clock and jumps it an hour, so that check runs at once.
Not proved here
- Any live installation: this was a disposable local stack, not Atlas or the public demo.
- A publicly trusted certificate: the browser was told to accept a self-signed one.
- An external identity provider; only the managed Keycloak with the production realm file.
- The rest of the browser suite; only
auth.spec.tsran against this stack. The Approvals spec still needs client administration that the production realm'skaryo-admindoes not have.