https://github.com/bitbeans/yubikey
Yubikey for Laravel 5
https://github.com/bitbeans/yubikey
Last synced: 7 months ago
JSON representation
Yubikey for Laravel 5
- Host: GitHub
- URL: https://github.com/bitbeans/yubikey
- Owner: bitbeans
- License: mit
- Created: 2015-04-23T14:36:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T06:27:35.000Z (over 4 years ago)
- Last Synced: 2025-08-23T06:03:56.379Z (7 months ago)
- Language: PHP
- Size: 33.2 KB
- Stars: 42
- Watchers: 6
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yubikey
Yubikey for Laravel 5
This package is based on the [Laravel 4 package](https://github.com/Monarobase/Yubikey) by Monarobase.
[Buy a Yubikey](https://store.yubico.com)
[Yubico API Key Generator](https://upgrade.yubico.com/getapikey/)
## Installation
Add `bitbeans/yubikey` to `composer.json`.
```
"bitbeans/yubikey": "dev-master"
```
Run `composer update` to pull down the latest version of Yubikey.
Now open up `/config/app.php` and add the service provider to your `providers` array.
```php
'providers' => [
Bitbeans\Yubikey\YubikeyServiceProvider::class,
]
```
And also the alias.
```php
'aliases' => [
'Yubikey' => Bitbeans\Yubikey\YubikeyFacade::class,
]
```
You can easily integrate the Yubikey Verification into your authentication system in two steps :
- Add a field (eg `yubikey_identity`) in your user table
- now check your user with username/email + password + yubikey_identity
## Configuration
Run `php artisan vendor:publish` and modify the config file (PROJECTFOLDER/config/yubikey.php) with your own information.
## Example
```php
use YubiKey;
try {
$yubikey_auth = Yubikey::verify(Input::get('otp'));
$yubikey_params = Yubikey::getParameters();
$yubikey_identity = Yubikey::getParameter('identity');
} catch (\Exception $exception) {
$error = $e->getMessage();
}
```