fix(keycloak): resolve an organization by alias, not by display name #30

Merged
sharang merged 1 commits from fix/org-lookup-by-alias into main 2026-09-14 11:30:01 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5 7a269b773d fix(keycloak): resolve an organization by alias, not by display name
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Successful in 22m31s
ci / image (pull_request) Skipped
Every Team page came back empty and every invite would have failed: the
organization lookup asked Keycloak for search=<slug>&exact=true, but exact
compares the display name, and the registry names organizations after the
company while the alias carries the slug. The demo tenant proved it — Keycloak
listed one member, the registry reported none.

It now asks for q=alias:<slug> and falls back to a substring search, comparing
the alias in both cases so a neighbouring slug (demo beside stage-demo) is
never returned instead. The fake in the tests now mirrors KC 26's three query
behaviours, and a regression test covers the name/alias mismatch, the
neighbour and the genuine miss.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-14 13:05:30 +02:00