Keycloak
1import Keycloak from "keycloak-js";
2
3import environment from "./environment";
4
5export const keycloak = new Keycloak({
6url: environment.authServerUrl,
7realm: environment.loginRealm,
8clientId: environment.clientId,
9});
10
11export async function initKeycloak() {
12const authenticated = await keycloak.init({
13onLoad: "check-sso",
14});
15
16// Force the user to login if not authenticated.
17if (!authenticated) {
18await keycloak.login();
19}
20}
21