An open API service indexing awesome lists of open source software.

https://github.com/cryptiklemur/yubico-php-client

Yubico YubiCloud PHP Client library
https://github.com/cryptiklemur/yubico-php-client

Last synced: 8 months ago
JSON representation

Yubico YubiCloud PHP Client library

Awesome Lists containing this project

README

          

# Yubico PHP Client

### Installation

Add the `yubico/yubico-php-client` package to your `require` section in your `composer.json`

```js
{
// ...
"require": {
// ...
"yubico/yubico-php-client": "~2.0.0"
}
}
```

### Usage

A Quick Example:

```php
$otp = "ccbbddeertkrctjkkcglfndnlihhnvekchkcctif";

// Generate a new id+key from https://api.yubico.com/get-api-key/
$yubi = new \Yubico\YubiCloud('42', 'FOOBAR=');

try {
$auth = $yubi->verify($otp);
echo "

You are authenticated!";
} catch (\Exception $e) {
echo "

Authentication failed: ".$auth->getMessage();
echo "

Debug output from server: ".$yubi->getLastResponse();
}
```