From db1ea6b70c39048e0dcc1d5ab7c63fc2e62e376b Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Mon, 31 Oct 2022 13:47:59 +0100 Subject: [PATCH] Stop using Keycloak config endpoint for Admin Client (#3669) This reverts commit 6a75c6da6bfd640e7f04760420870c3b74741287. --- .../admin-ui/src/context/auth/AdminClient.tsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/apps/admin-ui/src/context/auth/AdminClient.tsx b/apps/admin-ui/src/context/auth/AdminClient.tsx index 75d7d531ae..d5f873568e 100644 --- a/apps/admin-ui/src/context/auth/AdminClient.tsx +++ b/apps/admin-ui/src/context/auth/AdminClient.tsx @@ -71,21 +71,14 @@ export function useFetch( }, deps); } -function getKeycloakConfig() { - if (environment.isRunningAsTheme) { - return environment.consoleBaseUrl + "config"; - } - - return { +export async function initAdminClient() { + const keycloak = new Keycloak({ url: environment.authServerUrl, realm: environment.loginRealm, - clientId: "security-admin-console-v2", - }; -} - -export async function initAdminClient() { - const config = getKeycloakConfig(); - const keycloak = new Keycloak(config); + clientId: environment.isRunningAsTheme + ? "security-admin-console" + : "security-admin-console-v2", + }); await keycloak.init({ onLoad: "check-sso", pkceMethod: "S256" });