surfnet / yubikey-api-client-bundle
A Symfony bundle to integrate Yubikey OTP validation service.
Installs: 11 519
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 10
Forks: 2
Open Issues: 0
Requires
- php: ^5.6|^7.0
- surfnet/yubikey-api-client: ^2.3
- symfony/config: ^2.7|^3.0|^4.4
- symfony/dependency-injection: ^2.7|^3.0|^4.4
- symfony/http-kernel: ^2.7|^3.0|^4.4
Requires (Dev)
- matthiasnoback/symfony-config-test: ^1.4
- mockery/mockery: 0.9.*
- phpmd/phpmd: ^2.0
- phpunit/phpunit: ^4.0
- sebastian/phpcpd: ^2.0
- sensiolabs/security-checker: ^6
- squizlabs/php_codesniffer: ^3
- symfony/framework-bundle: >=2.3,<4
- symfony/monolog-bundle: ^2.11
This package is auto-updated.
Last update: 2023-09-15 12:45:29 UTC
README
Build Status | Scrutinizer Code Quality | |
---|---|---|
develop | ||
master |
A Symfony bundle to integrate Yubikey's OTP validation service.
Installation
Add the bundle to your Composer file.
composer require 'surfnet/yubikey-api-client-bundle'
Add the bundle to your AppKernel.
public function registerBundles() { $bundles[] = new Surfnet\YubikeyApiClientBundle\SurfnetYubikeyApiClientBundle; }
Usage
public function fooAction() { /** @var \Surfnet\YubikeyApiClientBundle\Service\VerificationService */ $service = $this->get('surfnet_yubikey_api_client.verification_service'); if (!\Surfnet\YubikeyApiClient\Otp::isValid('user-input-otp-here')) { // User-entered OTP string is not valid. } $otp = \Surfnet\YubikeyApiClient\Otp::fromString('user-input-otp-here'); $result = $service->verify($otp); if ($result->isSuccessful()) { // Yubico verified OTP. } }