Skip to content

Instantly share code, notes, and snippets.

@gdestuynder
Created July 5, 2019 23:21
Show Gist options
  • Save gdestuynder/9ea28f06f48d133d6e2c708e60953420 to your computer and use it in GitHub Desktop.
Save gdestuynder/9ea28f06f48d133d6e2c708e60953420 to your computer and use it in GitHub Desktop.
diff --git a/demos/simple-v2/index.php b/demos/simple-v2/index.php
index bbb7d96..74691c4 100644
--- a/demos/simple-v2/index.php
+++ b/demos/simple-v2/index.php
@@ -4,7 +4,7 @@ require_once '../../vendor/autoload.php';
-const IKEY = '';
+const IKEY = 'REDACTED';
-const SKEY = '';
+const SKEY = 'REDACTED';
-const AKEY = '';
+const AKEY = 'REDACTED';
-const HOST = '';
+const HOST = 'REDACTED';
@@ -22,6 +22,9 @@ $template = <<<'EOD'
</style>
</head>
<body>
+<h1>Duo Security Web SDK Demo | THIS IS NOT A PRODUCTION SYSTEM, THIS IS A BETA IMPLEMENTATION</h1>
+<p>This page is used to setup a test U2F token that will function for WebAuthN authentication. You have been given access to the BETA test setup for this purpose.</p>
+<p>Please use https://login.mozilla.com for ANY other production changes to your account</p>
<form method="post" id="duo_form"></form>
<iframe id="duo_iframe"
data-host="%s"
@@ -42,13 +45,10 @@ $client = new \DuoAPI\Frame(
\DuoAPI\SIGNATURE_CANON_JSON_STRING_BODY
);
-if ($_SERVER['REQUEST_METHOD'] === 'GET') {
- if (!array_key_exists('username', $_GET)) {
- die("Please include a 'username' parameter.");
- }
-
- $username = $_GET['username'];
+if (isset($_SERVER['HTTP_X_FORWARDED_USER']) ) {
+ $username = $_SERVER['HTTP_X_FORWARDED_USER'];
$txid = \Duo\Web::initAuth($client, IKEY, AKEY, $username);
$html = sprintf($template, HOST, $txid);
echo $html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment