Auth_Yubico PHP class


Table of Contents

Status and Roadmap
Installation
Example usage
Feedback

The Yubico authentication PHP class provides an easy way to integrate the Yubikey into your existing PHP-based user authentication infrastructure. Installation is simple using PEAR.

Status and Roadmap

The module is working. Several items have been identified that needs to be implemented before it can reach production quality. Search for TODO in Yubico.php.

The development community is co-ordinated via Google Code:

http://code.google.com/p/php-yubico/

The license for php-yubico is the revised BSD license. See the file COPYING for more information.

Installation

Make sure your PHP installation supports curl, and that you have installed PEAR. Install the component by invoking:

wget http://www.yubico.com/files/Auth_Yubico-1.1.tgz
pear install Auth_Yubico-1.1.tgz

Example usage

The class is easy to use, in an HTML *.php file you invoke it as follows:

<?php
$otp = "ccbbddeertkrctjkkcglfndnlihhnvekchkcctif";
$yubi = &new Auth_Yubico('42'); # 42 is your id
$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!";
}
?>

Feedback

If you want to discuss anything related to the Yubico PHP class, please contact Simon Josefsson.