keycloak
This commit is contained in:
22
public/auth/keycloak/index.php
Normal file
22
public/auth/keycloak/index.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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'));
|
||||
$loginUrl = $auth->loginUrl();
|
||||
|
||||
if ($loginUrl === null) {
|
||||
header('Location: /auth/login');
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Location: ' . $loginUrl, true, 302);
|
||||
exit;
|
||||
Reference in New Issue
Block a user