surfnet / yubikey-api-client-bundle
A Symfony bundle to integrate Yubikey OTP validation service.
Installs: 12 328
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 12
Forks: 2
Open Issues: 0
Requires
- php: ^8.2
- surfnet/yubikey-api-client: ^2.3
- symfony/config: ^5.0|^6.0
- symfony/console: ^6.4
- symfony/dependency-injection: ^5.0|^6.0
- symfony/http-kernel: ^5.0|^6.0
- symfony/yaml: ^6.4
Requires (Dev)
- matthiasnoback/symfony-config-test: ^5.0
- mockery/mockery: ^1.6
- overtrue/phplint: ^9.0
- phpmd/phpmd: ^2.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-mockery: ^1.1
- phpstan/phpstan-symfony: ^1.3
- phpunit/phpunit: ^9.0
- sebastian/phpcpd: ^6.0
- slevomat/coding-standard: ^8.15
- squizlabs/php_codesniffer: ^3
- symfony/framework-bundle: ^v5.4.36
- symfony/monolog-bundle: ^3.0
- dev-develop
- dev-main
- 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-dependabot/composer/symfony/http-foundation-6.4.14
- dev-dependabot/composer/symfony/process-7.1.7
- 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: 2024-11-20 09:50:41 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. } }