Initial commit
This commit is contained in:
commit
48a5360d0d
22 changed files with 1687 additions and 0 deletions
27
index.php
Normal file
27
index.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
require __DIR__ . '/config/config.php';
|
||||
|
||||
use Jumbojett\OpenIDConnectClient;
|
||||
|
||||
session_start();
|
||||
|
||||
$oidc = new OpenIDConnectClient($CONFIG['oidc']['url'],
|
||||
$CONFIG['oidc']['clientid'],
|
||||
$CONFIG['oidc']['secret']);
|
||||
$oidc->setRedirectURL($CONFIG['baseurl'] . 'callback.php');
|
||||
|
||||
// check if user is logged in
|
||||
if (isset($_SESSION['id_token'])) {
|
||||
header('Location: card.php');
|
||||
/*echo "Willkommen,";
|
||||
echo '<br><a href="card.php">Ausweis anzeigen</a>';
|
||||
echo '<br><a href="card.php?pdf=true" download="schuelerausweis.pdf">Ausweis download (pdf)</a>';
|
||||
echo '<br><a href="logout.php">Abmelden</a>';*/
|
||||
} else {
|
||||
// redirect to keycloak login
|
||||
$oidc->authenticate();
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue