PHP code example of bulldog / yubico

1. Go to this page and download the library: Download bulldog/yubico library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bulldog / yubico example snippets



Bulldog\Yubico\Yubico;
use Bulldog\Yubico\Adapters\GuzzleAdapter;

$yubico = new Yubico('1234', 'c2VjcmV0X2tleQ==', new GuzzleAdapter());

if($yubico->verify('longonetimepasswordgeneratedfromayubicokey')) {
    echo "That OTP is good!\n";
} else {
    echo "OTP is bad!\n";
    echo $yubico->getReason() . "\n";
}