summaryrefslogtreecommitdiffstats
path: root/examples/server/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/server/index.php')
-rw-r--r--examples/server/index.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/server/index.php b/examples/server/index.php
new file mode 100644
index 0000000..5416eb9
--- /dev/null
+++ b/examples/server/index.php
@@ -0,0 +1,18 @@
+<?php
+
+require_once __DIR__ . '/../../vendor/autoload.php';
+require_once 'MySSOServer.php';
+
+$ssoServer = new MySSOServer();
+$command = isset($_REQUEST['command']) ? $_REQUEST['command'] : null;
+
+if (!$command || !method_exists($ssoServer, $command)) {
+ header("HTTP/1.1 404 Not Found");
+ header('Content-type: application/json; charset=UTF-8');
+
+ echo json_encode(['error' => 'Unknown command']);
+ exit();
+}
+
+$result = $ssoServer->$command();
+