surfnet / yubikey-api-client-bundle
A Symfony bundle to integrate Yubikey OTP validation service.
Installs: 13 413
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 10
Forks: 1
Open Issues: 0
pkg:composer/surfnet/yubikey-api-client-bundle
Requires
- php: ^8.2
- surfnet/yubikey-api-client: ^2.3
- symfony/config: ^6.0|^7.0
- symfony/console: ^6.0|^7.0
- symfony/dependency-injection: ^6.0|^7.0
- symfony/http-kernel: ^6.0|^7.0
- symfony/yaml: ^6.0|^7.0
Requires (Dev)
- irstea/phpcpd-shim: *
- malukenho/docheader: ^1.1
- matthiasnoback/symfony-config-test: ^6.1
- overtrue/phplint: ^9.0
- phpmd/phpmd: ^2.0
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.5.43
- rector/rector: ^2.2
- slevomat/coding-standard: ^8.24
- squizlabs/php_codesniffer: ^4.0
- symfony/framework-bundle: ^7.3
- symfony/monolog-bundle: ^3.0
- dev-main
- 6.0.0
- 5.0.0
- 5.0.0-beta1
- 4.1.1
- 4.1.0
- 4.0.0
- 3.0.1
- 3.0.0
- 2.0.0
- 1.2.0
- 1.1.0
- 1.0.0
- dev-feature/fix-version-numbering-in-changelog
- dev-feature/maintenance-nov-25
- dev-develop
- dev-develop-rebased-on-master
- dev-feature/upgrade-sf6-compatible
- dev-feature/lockfile
- dev-feature/update-deps
- dev-release/3.0
This package is auto-updated.
Last update: 2025-11-17 08:30:17 UTC
README
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. } }