pmdevelopment/yubikey-otp-bundle

在 Symfony2 中验证 Yubikey OTP

1.1 2018-03-01 09:04 UTC

This package is auto-updated.

Last update: 2024-09-12 01:55:21 UTC


README

安装

添加到 composer

  composer require "pmdevelopment/yubikey-otp-bundle" "dev-master"

添加到 kernel

  new PM\Bundle\YubikeyOtpBundle\PMYubikeyOtpBundle(),

添加到 config.yml

    pm_yubikey_otp:
      server:
        uri: https://api2.yubico.com/wsapi/2.0/
        client_id: YourClientId
        client_secret: YourApiKey

用法

现在您可以使用服务验证任何 OTP

   $this->get("pm_yubikey_otp.validation")->verify("YourOtpToValidate", "OptionalTheIdentityYouExpect");