Files
desktop/public/auth/keycloak/index.php
Lars Gebhardt-Kusche 2d46b05b1e
All checks were successful
Deploy / deploy-staging (push) Successful in 29s
Deploy / deploy-production (push) Has been skipped
deploy
2026-06-27 23:59:21 +02:00

25 lines
554 B
PHP

<?php
declare(strict_types=1);
require_once dirname(__DIR__, 3) . '/src/App/bootstrap.php';
use App\ConfigLoader;
use App\KeycloakAuth;
session_start();
$projectRoot = dirname(__DIR__, 3);
$auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
$mode = trim((string) ($_GET['mode'] ?? ''));
$loginUrl = $auth->loginUrl($mode === 'silent' ? ['prompt' => 'none'] : []);
if ($loginUrl === null) {
http_response_code(503);
echo 'Keycloak ist nicht konfiguriert.';
exit;
}
header('Location: ' . $loginUrl, true, 302);
exit;