OIDC test

This commit is contained in:
matt committed 2026-10-23 03:22:30 -07:00
1 parent fd79a027a2
commit 965d2d084a
9 files changed
+259

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/config.php';
?>
<!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>
<body>
<h1>Fitness Site – OIDC Demo</h1>
<?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; ?>
</body>
</html>