OIDC test - test jumbojett oidc php app
This commit is contained in:
1 parent
a759eb206f
commit
97a31db020
6 files changed
+79
-98
No files matched your search
+12
-31
@@ -1,38 +1,19 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require_once __DIR__ . '/config.php';
|
||||
session_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Fitness Site – OIDC Demo</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 2rem; }
|
||||
.info { margin-top: 1rem; }
|
||||
pre { background: #f4f4f4; padding: 1rem; }
|
||||
</style>
|
||||
</head>
|
||||
<html>
|
||||
<head><title>Fitness – OIDC Demo</title></head>
|
||||
<body>
|
||||
<h1>Fitness Site – OIDC Demo</h1>
|
||||
<?php if (!isset($_SESSION['user'])): ?>
|
||||
<a href="/login.php"><button>Login with Authelia</button></a>
|
||||
<?php else: ?>
|
||||
<h2>Welcome, <?= htmlspecialchars($_SESSION['user']['userinfo']['name'] ?? '??') ?>!</h2>
|
||||
<p>Email: <?= htmlspecialchars($_SESSION['user']['userinfo']['email'] ?? '') ?></p>
|
||||
<p>Groups: <?= htmlspecialchars(implode(', ', $_SESSION['user']['userinfo']['groups'] ?? [])) ?></p>
|
||||
<p>JWT claims: <pre><?= htmlspecialchars(print_r($_SESSION['user']['claims'], true)) ?></pre></p>
|
||||
|
||||
<?php if (!isset($_SESSION['user'])): ?>
|
||||
<p>You are not logged in.</p>
|
||||
<p><a href="/login.php"><button>Login with Authelia</button></a></p>
|
||||
<?php else: ?>
|
||||
<p>Logged in as: <strong><?=htmlspecialchars($_SESSION['user']['user_info']['name'] ?? 'N/A')?></strong></p>
|
||||
|
||||
<div class="info">
|
||||
<h2>User Information</h2>
|
||||
<pre><?=htmlspecialchars(json_encode($_SESSION['user']['user_info'], JSON_PRETTY_PRINT))?></pre>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<h2>ID Token Payload (claims)</h2>
|
||||
<pre><?=htmlspecialchars(json_encode($_SESSION['user']['id_info'], JSON_PRETTY_PRINT))?></pre>
|
||||
</div>
|
||||
|
||||
<p><a href="/logout.php"><button>Logout</button></a></p>
|
||||
<?php endif; ?>
|
||||
<a href="/logout.php"><button>Logout</button></a>
|
||||
<?php endif; ?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user