Stop using Keycloak config endpoint for Admin Client (#3669)

This reverts commit 6a75c6da6b.
This commit is contained in:
Jon Koops 2022-10-31 13:47:59 +01:00 committed by GitHub
parent cec8e5f547
commit db1ea6b70c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,21 +71,14 @@ export function useFetch<T>(
}, deps); }, deps);
} }
function getKeycloakConfig() { export async function initAdminClient() {
if (environment.isRunningAsTheme) { const keycloak = new Keycloak({
return environment.consoleBaseUrl + "config";
}
return {
url: environment.authServerUrl, url: environment.authServerUrl,
realm: environment.loginRealm, realm: environment.loginRealm,
clientId: "security-admin-console-v2", clientId: environment.isRunningAsTheme
}; ? "security-admin-console"
} : "security-admin-console-v2",
});
export async function initAdminClient() {
const config = getKeycloakConfig();
const keycloak = new Keycloak(config);
await keycloak.init({ onLoad: "check-sso", pkceMethod: "S256" }); await keycloak.init({ onLoad: "check-sso", pkceMethod: "S256" });