Skip to content

Instantly share code, notes, and snippets.

@AngeloR
Created January 22, 2014 17:12
Show Gist options
  • Save AngeloR/8562825 to your computer and use it in GitHub Desktop.
Save AngeloR/8562825 to your computer and use it in GitHub Desktop.
<?php
include("Yubikey.php")
$id = 00000;
$signature = 'yoursignature';
if(isset($_POST) && array_key_exists('otp', $_POST)) {
$token = new Yubikey($id, $signature);
if($token->verify($_POST['otp'])) {
echo 'Verified!';
}
else {
echo 'Unverified...';
}
}
?>
<!doctype html>
<html>
<body>
<form action="yubikey-demo.php" method="post">
<input type="text" name="otp" value="">
<button type="submit">Verify</button>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment