Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2018 | - | ||||
COPYING | H A D | 03-Jan-2017 | 1.5 KiB | 31 | 25 | |
NEWS | H A D | 03-Jan-2017 | 1.3 KiB | 48 | 33 | |
README | H A D | 03-Jan-2017 | 2.6 KiB | 76 | 55 | |
Yubico.php | H A D | 03-Jan-2017 | 12.1 KiB | 471 | 234 |
README
1== Auth_Yubico PHP class == 2 3The Yubico authentication PHP class provides an easy way to integrate 4the Yubikey into your existing PHP-based user authentication 5infrastructure. Installation is simple using PEAR. 6 7The development community is co-ordinated via 8https://github.com/Yubico/php-yubico[the Github project]. 9 10 11=== Installation === 12 13Make sure your PHP installation supports curl, and that you have 14installed PEAR. On Debian/Ubuntu systems: 15 16 $ apt-get install libapache2-mod-php5 php5-curl php-pear 17 18Install the component by invoking: 19 20 $ wget https://developers.yubico.com/php-yubico/Releases/Auth_Yubico-2.5.tgz 21 $ pear install Auth_Yubico-2.5.tgz 22 23=== Usage === 24 25NOTE: Make sure that you have read https://developers.yubico.com/OTP/Libraries/Using_a_library.html[Using a YubiKey OTP library] before continuing. 26 27This is an example of how you can use the `Yubico.php` inside an HTML *.php file: 28 29[source, php] 30----------- 31<?php 32 require_once 'Auth/Yubico.php'; 33 $otp = "ccbbddeertkrctjkkcglfndnlihhnvekchkcctif"; 34 35 # Generate a new id+key from https://upgrade.yubico.com/getapikey 36 $yubi = new Auth_Yubico('42', 'FOOBAR='); 37 $auth = $yubi->verify($otp); 38 if (PEAR::isError($auth)) { 39 print "<p>Authentication failed: " . $auth->getMessage(); 40 print "<p>Debug output from server: " . $yubi->getLastResponse(); 41 } else { 42 print "<p>You are authenticated!"; 43 } 44?> 45----------- 46 47==== API demo 48 49Provided in the package is also a script 50https://github.com/Yubico/php-yubico/blob/master/demo.php[demo.php] 51that demonstrates how you may use the package. The script is deployed 52http://demo.yubico.com/php-yubico/demo.php[here]. 53 54==== Example site 55There is also a complete example site that demonstrates one-factor and 56two-factor mode. It requires a database to store the username and 57passwords. Database schema is in 58https://github.com/Yubico/php-yubico/blob/master/example/db.sql[example/db.sql] 59and configuration for the database needs to go into 60https://github.com/Yubico/php-yubico/blob/master/example/config.php[example/config.php]. 61 62The example site is deployed http://demo.yubico.com/php-yubico[here]. 63 64 65=== Modhex Calculator 66This package also includes 67https://github.com/Yubico/php-yubico/blob/master/example/Modhex_Calculator.php[Modhex_Calculator.php], 68a web page illustrating how to work with the modhex encoding. It is deployed 69http://demo.yubico.com/php-yubico/Modhex_Calculator.php[here] 70 71=== License 72The project is licensed under a BSD license. See the file COPYING for 73exact wording. For any copyright year range specified as YYYY-ZZZZ in 74this package note that the range specifies every single year in that 75closed interval. 76