Skip to content
Snippets Groups Projects
Select Git revision
  • 78d6513c40d84da669c02098f23807b4ff9cf6da
  • master default protected
  • 7771-harden-postgres-backup
  • pgsql-dump-with-snapshots
  • update-colors
  • update-docs-css
  • usb-repair-stick
  • desktop-notification
  • 7000-corrections
  • db-detector
10 results

verify.sh

Blame
  • AuthYubico.php 12.11 KiB
    <?php
    namespace Library\Authentication;
    
      /**
       * Class for verifying Yubico One-Time-Passcodes
       *
       * @category    Auth
       * @package     Auth_Yubico
       * @author      Simon Josefsson <simon@yubico.com>, Olov Danielson <olov@yubico.com>
       * @copyright   2007-2015 Yubico AB
       * @license     http://opensource.org/licenses/bsd-license.php New BSD License
       * @version     2.0
       * @link        http://www.yubico.com/
       */
    require_once 'PEAR.php';
    
    
    
    /**
     * Class for verifying Yubico One-Time-Passcodes
     *
     * Simple example:
     * <code>
     * require_once 'Auth/Yubico.php';
     * $otp = "ccbbddeertkrctjkkcglfndnlihhnvekchkcctif";
     *
     * # Generate a new id+key from https://api.yubico.com/get-api-key/
     * $yubi = new Auth_Yubico('42', 'FOOBAR=');
     * $auth = $yubi->verify($otp);
     * if (PEAR::isError($auth)) {
     *    print "<p>Authentication failed: " . $auth->getMessage();
     *    print "<p>Debug output from server: " . $yubi->getLastResponse();
     * } else {
     *    print "<p>You are authenticated!";
     * }
     * </code>
     */
    class AuthYubico
    {
    	/**#@+
    	 * @access private
    	 */
    
    	/**
    	 * Yubico client ID
    	 * @var string
    	 */
    	var $_id;
    
    	/**
    	 * Yubico client key
    	 * @var string
    	 */
    	var $_key;
    
    	/**
    	 * URL part of validation server
    	 * @var string
    	 */
    	var $_url;
    
    	/**
    	 * List with URL part of validation servers
    	 * @var array
    	 */
    	var $_url_list;
    
    	/**
    	 * index to _url_list
    	 * @var int