summaryrefslogtreecommitdiffstats
path: root/examples/broker/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/broker/index.php')
-rw-r--r--examples/broker/index.php46
1 files changed, 24 insertions, 22 deletions
diff --git a/examples/broker/index.php b/examples/broker/index.php
index de396a7..2a5f12d 100644
--- a/examples/broker/index.php
+++ b/examples/broker/index.php
@@ -1,9 +1,13 @@
<?php
-
require_once __DIR__ . '/../../vendor/autoload.php';
-$broker = new Jasny\SSO\Broker(getenv('SSO_SERVER_URL'), getenv('SSO_BROKER_ID'), getenv('SSO_BROKER_SECRET'));
-$broker->attach();
+if (isset($_GET['sso_error'])) {
+ header("Location: error.php?sso_error=" . $_GET['sso_error'], true, 307);
+ exit;
+}
+
+$broker = new Jasny\SSO\Broker(getenv('SSO_SERVER'), getenv('SSO_BROKER_ID'), getenv('SSO_BROKER_SECRET'));
+$broker->attach(true);
$user = $broker->getUserInfo();
@@ -11,27 +15,25 @@ if (!$user) {
header("Location: login.php", true, 307);
exit;
}
-
?>
<!doctype html>
<html>
- <head>
- <title>Single Sign-On demo (<?= $broker->broker ?>)</title>
- </head>
- <body>
- <h1>Single Sign-On demo</h1>
- <h2><?= $broker->broker ?></h2>
- <?php if ($user) : ?>
- <h3>Logged in</h3>
- <?php
-endif ?>
+ <head>
+ <title><?= $broker->broker ?> (Single Sign-On demo)</title>
+ <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
+ </head>
+ <body>
+ <div class="container">
+ <h1><?= $broker->broker ?> <small>(Single Sign-On demo)</small></h1>
+ <h3>Logged in</h3>
- <dl>
- <?php foreach ($user as $key => $value) : ?>
- <dt><?= $key ?></dt><dd><?= $value ?></dd>
- <?php
-endforeach; ?>
- </dl>
- <a id="logout" href="login.php?logout=1">Logout</a>
- </body>
+ <dl class="dl-horizontal">
+ <?php foreach ($user as $key => $value) : ?>
+ <dt><?= $key ?></dt><dd><?= $value ?></dd>
+ <?php endforeach; ?>
+ </dl>
+
+ <a id="logout" class="btn btn-default" href="login.php?logout=1">Logout</a>
+ </div>
+ </body>
</html>