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);
}
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" });