ADR-0131: per-profile client sign-in for several clients on one machine
Foundation / checks (ecs) (push) Successful in 2m21s
Foundation / checks (deploy) (push) Successful in 4m9s
Foundation / checks (tsan) (push) Successful in 9m48s
Foundation / checks (client) (push) Successful in 19m17s
Foundation / checks (network) (push) Successful in 19m44s
Foundation / checks (checks) (push) Successful in 42m37s
Foundation / checks (postgres) (push) Successful in 45m40s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 3m13s
Foundation / image (push) Successful in 3m27s

Only one client per machine could sign in: the saved login lived under a single
Credential Manager name, and Keycloak ignores prompt=select_account, so the
browser reused its single sign-on session. --profile NAME keeps one saved login
per profile (the default name is unchanged), and authorization asks for
prompt=login so the browser shows the login form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-15 17:35:53 -04:00
co-authored by Claude Opus 5.5
parent 898c921da8
commit a97f0c3fea
10 changed files with 79 additions and 16 deletions
+11 -1
View File
@@ -94,10 +94,20 @@ void protocol_tests() {
"https://auth.aeternalisgames.com/realms/aeternalis/protocol/openid-connect/auth?"));
for (const std::string_view part :
{"client_id=aevolution-game", "response_type=code", "code_challenge_method=S256",
"code_challenge=ch", "state=st",
"code_challenge=ch", "state=st", "prompt=login",
"redirect_uri=http%3A%2F%2F127.0.0.1%3A47600%2Fcallback"})
CHECK(url.find(part) != std::string::npos);
// Profiles: one saved login each; the default keeps the original credential name.
CHECK(auth_profile_valid("") && auth_profile_valid("alt-2_B") &&
auth_profile_valid(std::string(32, 'a')));
for (const std::string_view bad : {"a b", "a/b", "..", "a\\b", "\xC3\xA9", "a:b"})
CHECK(!auth_profile_valid(bad));
CHECK(!auth_profile_valid(std::string(33, 'a')));
CHECK(auth_credential_name("") == "AeternalisEvolution/DEV/refresh-token/v1");
CHECK(auth_credential_name("second") == "AeternalisEvolution/DEV/refresh-token/v1/second");
CHECK(!native_auth_platform("bad name"));
// Callback: exact path, the one state, one code; denial and anything else refused.
CHECK(auth_callback("/callback?state=st&code=abc.DEF-1&session_state=x", "st") == "abc.DEF-1");
CHECK(auth_callback("/callback?code=c&state=st&iss=https%3A%2F%2Fauth.aeternalisgames.com%2F"