OIDC test - test jumbojett oidc round two 1

This commit is contained in:
matt committed 2026-10-28 21:40:23 -07:00
1 parent 6f8dd7bbe3
commit 65a69b585d
9 files changed
+85 -226

No files matched your search

+20 -16
View File
@@ -1,19 +1,23 @@
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head><title>Fitness - OIDC Demo</title></head>
<body>
<?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>
$config = require __DIR__ . '/../config.php';
<a href="/logout.php"><button>Logout</button></a>
<?php endif; ?>
</body>
</html>
if (!isset($_SESSION['authenticated'])) {
// User not logged in – show a login button
echo '<h1>Welcome to the demo</h1>';
echo '<p><a href="auth.php">Login with Authelia SSO</a></p>';
exit;
}
// The user is logged in – display the attributes
$name = $_SESSION['name'] ?? 'unknown';
$email = $_SESSION['email'] ?? 'unknown';
$groups = $_SESSION['groups'] ?? [];
echo '<h1>Logged in as ' . htmlspecialchars($name) . '</h1>';
echo '<ul>';
echo '<li><strong>Email:</strong> ' . htmlspecialchars($email) . '</li>';
echo '<li><strong>Groups:</strong> ' . htmlspecialchars(implode(', ', $groups)) . '</li>';
echo '</ul>';
echo '<p><a href="logout.php">Logout</a></p>';