ns/token-bundle

此扩展包提供了与symfony的JWT令牌集成

4.0.3 2024-05-01 19:54 UTC

README

  composer require ns/token-bundle

编辑 AppKernel.php 并添加扩展包

    new NS\TokenBundle\NSTokenBundle(),

编辑 app/config/config.yml

    ns_token:
        generator:
            id: <some random string>
            key: <another random string>
            issuer: <string (often the site source)>
            short_expiration: 3600
            long_expiration: 2592000
            signer: Lcobucci\JWT\Signer\Rsa\Sha256 #default

您可以通过实现 Lcobucci\JWT\Signer 接口来使用自己的签名者。