Viel neues
This commit is contained in:
32
qa-tool/htdocs/login.php
Normal file
32
qa-tool/htdocs/login.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
require_once 'vendor/autoload.php';
|
||||
include 'config/config.php';
|
||||
|
||||
use Jumbojett\OpenIDConnectClient;
|
||||
session_start();
|
||||
|
||||
if (getenv('AUTH_DISABLED') === 'true') {
|
||||
$_SESSION['user_authenticated'] = true;
|
||||
if (empty($_SESSION['user_name'])) { $_SESSION['user_name'] = 'localtest'; }
|
||||
header('Location: index.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
// OpenID Connect Client konfigurieren
|
||||
|
||||
$oidc = new OpenIDConnectClient(
|
||||
$oidc_provider, // OpenID Provider URL
|
||||
$oidc_client, // Client ID
|
||||
$oidc_secret // Client Secret
|
||||
);
|
||||
|
||||
// Weiterleitungen konfigurieren
|
||||
|
||||
$oidc->setRedirectURL($OIDC_REDIRECT_URL);
|
||||
|
||||
// Scopes als Array hinzufügen
|
||||
$oidc->addScope(['openid', 'profile', 'email', 'groups']);
|
||||
|
||||
// Benutzer zur Authentifizierungsseite weiterleiten
|
||||
$oidc->authenticate();
|
||||
?>
|
||||
Reference in New Issue
Block a user