cmuench / yubikey
Yubikey client library
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/cmuench/yubikey
Requires
- php: >=5.6.0
- php-http/client-implementation: ^1.0
- php-http/httplug: 1.0.*
- php-http/message: ^1.3
- php-http/message-factory: ^1.0.2
- psr/log: ^1.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- php-http/mock-client: 0.3.*
- phpunit/phpunit: 5.5.*
This package is auto-updated.
Last update: 2022-02-23 23:10:20 UTC
README
Provides a \CMuench\Yubikey\AuthenticationClient
class which can be used to authenticate against
the yubikey auth servers.
It's possible to add own servers by config.
Example:
<?php require_once 'vendor/autoload.php'; // with Guzzle // composer require "php-http/guzzle5-adapter" $otp = '<otp>'; // Onetime password $yubikey = '<yubikey>'; // Yubikey of the user $clientId = '<client_id>'; // Client-ID of the application $clientSecret = '<api_secret>'; // API-Secret of the application $apiConfiguration = new \CMuench\Yubikey\Value\ApiConfiguration($clientId, $clientSecret); $httpClient = new \Http\Adapter\Guzzle5(); $requestFactory = new \Http\Message\MessageFactory\GuzzleMessageFactory(); $client = new \CMuench\Yubikey\AuthenticationClient($apiConfiguration, $httpClient, $requestFactory); $isValid = $client->verify($otp, $yubikey);