spomky-labs / lexik-jose-bridge
Bridge to allow the use of web-token/jwt-framework with the Lexik JWT Authentication Bundle
Installs: 357 825
Dependents: 0
Suggesters: 2
Security: 0
Stars: 35
Watchers: 8
Forks: 15
Open Issues: 5
Type:symfony-bundle
Requires
- php: >=8.1
- lexik/jwt-authentication-bundle: ^2.0
- psr/event-dispatcher: ^1.0
- thecodingmachine/safe: ^2.0
- web-token/jwt-bundle: ^3.0
- web-token/jwt-checker: ^3.0
- web-token/jwt-encryption: ^3.0
- web-token/jwt-key-mgmt: ^3.0
- web-token/jwt-signature: ^3.0
- web-token/jwt-signature-algorithm-rsa: ^3.0
Requires (Dev)
- behat/behat: ^3.0
- caciobanu/behat-deprecation-extension: ^2.1
- ekino/phpstan-banned-code: ^1.0
- friends-of-behat/mink-browserkit-driver: ^1.6
- friends-of-behat/mink-extension: ^2.3
- friends-of-behat/symfony-extension: ^2.3
- phpstan/phpstan: ^1.0
- phpstan/phpstan-beberlei-assert: ^1.0
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
- rector/rector: ^0.12
- sensio/framework-extra-bundle: ^6.0
- symfony/dependency-injection: ^6.0
- symfony/expression-language: ^6.0
- symfony/finder: ^6.0
- symfony/form: ^6.0
- symfony/monolog-bundle: ^3.7
- symfony/templating: ^6.0
- symfony/twig-bundle: ^6.0
- symfony/var-dumper: ^6.0
- symplify/easy-coding-standard: ^10.0
- thecodingmachine/phpstan-safe-rule: ^1.0
- web-token/jwt-encryption-algorithm-aesgcm: ^3.0
- web-token/jwt-encryption-algorithm-aesgcmkw: ^3.0
- web-token/jwt-signature-algorithm-hmac: ^3.0
- v4.0.x-dev
- v4.0.0
- v3.0.x-dev
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.2.x-dev
- v2.2.1
- v2.2.0
- v2.1.x-dev
- v2.1.1
- v2.1.0
- v2.0.x-dev
- 2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-alpha.1
- v1.1.0
- v1.0.x-dev
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/composer/symplify/easy-coding-standard-tw-12.0
- dev-dependabot/composer/rector/rector-tw-0.17
This package is auto-updated.
Last update: 2024-11-26 07:16:04 UTC
README
This Symfony Bundle provides a JWT Encoder for the LexikJWTAuthenticationBundle that uses the web-token/jwt-framework as JWT Creator/Loader.
The Release Process
The release process is described here.
Prerequisites
This library needs at least:
- PHP 8.1+
- Symfony 6.0+.
Installation
Symfony Flex
The preferred way to install this bundle is to rely on Symfony Flex and composer. Before installing the bundle, it is mandatory to declare specific Flex servers into your composer.json file.
composer config --json extra.symfony.endpoint '["https://api.github.com/repos/Spomky-Labs/recipes/contents/index.json?ref=main", "flex://defaults"]'
Or if you prefer, you can directly update your composer.json
file.
{ "name": "acme/application", "description": "ACME Application", "extra": { "symfony": { "endpoint": [ "https://api.github.com/repos/Spomky-Labs/recipes/contents/index.json?ref=main", "flex://defaults" ] } } }
Then, you can install the bundle. It will be automatically configured with the default configuration.
composer require spomky-labs/lexik-jose-bridge
Manual Installation
If you do not use Symfony Flex, then use Composer and install the bundle manually.
Then, add this bundle and the web-token/jwt-framework
bundles into your kernel:
<?php use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\HttpKernel\Kernel; class AppKernel extends Kernel { public function registerBundles() { $bundles = [ ... new Jose\Bundle\JoseFramework\JoseFrameworkBundle(), new SpomkyLabs\LexikJoseBundle\SpomkyLabsLexikJoseBundle(), ]; return $bundles; } }
Signature/Encryption Algorithms
This bundle only installs the RSA based signature algorithms (RS256
, RS384
and RS512
).
If you need other signature algorithms (e.g EC based, HMAC) or if you want to use the encryption feature,
you must install the corresponding packages:
- Signature Algorithms
- All:
composer require web-token/signature-pack
(not recommended) - HMAC:
composer require web-token/jwt-signature-algorithm-hmac
- ECDSA:
composer require web-token/jwt-signature-algorithm-ecdsa
- EdDSA:
composer require web-token/jwt-signature-algorithm-eddsa
- None:
composer require web-token/jwt-signature-algorithm-none
(not recommended) - Experimental:
composer require web-token/jwt-signature-algorithm-experimental
(not recommended)
- All:
- Encryption Algorithms
- All:
composer require web-token/encryption-pack
(not recommended) - Key Encryption:
- ECDH-ES:
composer require web-token/jwt-encryption-algorithm-ecdh-es
- AES Key Wrapping:
composer require web-token/jwt-encryption-algorithm-aeskw
- RSA:
composer require web-token/jwt-encryption-algorithm-rsa
- AES GCM Key Wrapping:
composer require web-token/jwt-encryption-algorithm-aesgcmkw
- Direct:
composer require web-token/jwt-encryption-algorithm-dir
(not recommended) - PBES 2:
composer require web-token/jwt-encryption-algorithm-pbes2
(not recommended)
- ECDH-ES:
- Content Encryption:
- AES GCM:
composer require web-token/jwt-encryption-algorithm-aesgcm
- AES CBC:
composer require web-token/jwt-encryption-algorithm-aescbc
- AES GCM:
- Experimental:
composer require web-token/jwt-encryption-algorithm-experimental
(not recommended)
- All:
Configuration
This bundle needs to be configured. Please see this page to know how to configure it.
How to use
There is nothing to do. Just use your application as usual.
Support
I bring solutions to your problems and answer your questions.
If you really love that project and the work I have done or if you want I prioritize your issues, then you can help me out for a couple of 🍻 or more!
Or
Contributing
If you discover a security vulnerability within the project, please don't use the bug tracker and don't publish it publicly. Instead, all security issues must be sent to security [at] spomky-labs.com.
Licence
This project is release under MIT licence.