Use Keycloak config endpoint in production (#3471)
This commit is contained in:
parent
3694dad23c
commit
6a75c6da6b
1 changed files with 13 additions and 6 deletions
|
@ -71,14 +71,21 @@ export function useFetch<T>(
|
||||||
}, deps);
|
}, deps);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function initAdminClient() {
|
function getKeycloakConfig() {
|
||||||
const keycloak = new Keycloak({
|
if (environment.isRunningAsTheme) {
|
||||||
|
return environment.consoleBaseUrl + "config";
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
url: environment.authServerUrl,
|
url: environment.authServerUrl,
|
||||||
realm: environment.loginRealm,
|
realm: environment.loginRealm,
|
||||||
clientId: environment.isRunningAsTheme
|
clientId: "security-admin-console-v2",
|
||||||
? "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" });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue