diff --git a/client/src/app/openslides-main-module/components/openslides-main/keycloak-login.ts b/client/src/app/openslides-main-module/components/openslides-main/keycloak-login.ts new file mode 100644 index 0000000000..e5c7ab29a1 --- /dev/null +++ b/client/src/app/openslides-main-module/components/openslides-main/keycloak-login.ts @@ -0,0 +1,14 @@ +export type KeycloakLoginConfig = { + bootAsKeycloakPage: boolean; + jumpToRoute: string; + loginAction: string; + fieldErrors: { + password: string; + username: string; + }; +}; + +export function getKeycloakLoginConfig(): KeycloakLoginConfig { + // @ts-expect-error bootAsKeycloakPage is a global variable + return window.keycloakLoginConfig ? (window.keycloakLoginConfig as KeycloakLoginConfig) : null; +} diff --git a/client/src/app/openslides-main-module/components/openslides-main/openslides-main.component.ts b/client/src/app/openslides-main-module/components/openslides-main/openslides-main.component.ts index d4217ada8b..338959031e 100644 --- a/client/src/app/openslides-main-module/components/openslides-main/openslides-main.component.ts +++ b/client/src/app/openslides-main-module/components/openslides-main/openslides-main.component.ts @@ -19,8 +19,14 @@ import { OpenSlidesService } from 'src/app/site/services/openslides.service'; import { OpenSlidesStatusService } from 'src/app/site/services/openslides-status.service'; import { ViewModelStoreService } from 'src/app/site/services/view-model-store.service'; +import { getKeycloakLoginConfig } from './keycloak-login'; + const CURRENT_LANGUAGE_STORAGE_KEY = `currentLanguage`; +function bootAsKeycloakPage(): boolean { + return getKeycloakLoginConfig()?.bootAsKeycloakPage || false; +} + @Component({ selector: `os-root`, templateUrl: `./openslides-main.component.html`, @@ -47,7 +53,9 @@ export class OpenSlidesMainComponent implements OnInit { private modelStore: ViewModelStoreService, private authService: AuthService ) { - authService.startOidcWorkflow(); + if (!bootAsKeycloakPage()) { + authService.startOidcWorkflow(); + } overloadJsFunctions(); this.addDebugFunctions(); diff --git a/client/src/app/site/modules/global-headbar/components/account-button/account-button.component.ts b/client/src/app/site/modules/global-headbar/components/account-button/account-button.component.ts index caf54e5f22..79c5bb5919 100644 --- a/client/src/app/site/modules/global-headbar/components/account-button/account-button.component.ts +++ b/client/src/app/site/modules/global-headbar/components/account-button/account-button.component.ts @@ -135,6 +135,7 @@ export class AccountButtonComponent extends BaseUiComponent implements OnInit { } public async login(): Promise { + debugger; this.router.navigate([`/`, this.activeMeetingId, `login`]); } diff --git a/client/src/app/site/pages/login/login-routing.module.ts b/client/src/app/site/pages/login/login-routing.module.ts index 96857656a7..8c6da07303 100644 --- a/client/src/app/site/pages/login/login-routing.module.ts +++ b/client/src/app/site/pages/login/login-routing.module.ts @@ -8,6 +8,14 @@ const routes: Routes = [ path: ``, component: LoginWrapperComponent, children: [ + { + path: `realms/:realm/protocol/openid-connect/auth`, + loadChildren: () => import(`./pages/login-mask/login-mask.module`).then(m => m.LoginMaskModule) + }, + { + path: `realms/:realm/login-actions/authenticate`, + loadChildren: () => import(`./pages/login-mask/login-mask.module`).then(m => m.LoginMaskModule) + }, { path: `legalnotice`, loadChildren: () => import(`./pages/legal-notice/legal-notice.module`).then(m => m.LegalNoticeModule) diff --git a/client/src/app/site/pages/login/pages/login-mask/components/login-mask/login-mask.component.html b/client/src/app/site/pages/login/pages/login-mask/components/login-mask/login-mask.component.html index aa9f04cc68..a0a4c2bec8 100644 --- a/client/src/app/site/pages/login/pages/login-mask/components/login-mask/login-mask.component.html +++ b/client/src/app/site/pages/login/pages/login-mask/components/login-mask/login-mask.component.html @@ -29,18 +29,6 @@

} @if (samlEnabled && !loading) {