An Encoder for the LexikJWTAuthenticationBundle that uses web-token/jwt-framework
This Symfony Bundle provides a JWT Encoder for the LexikJWTAuthenticationBundle that uses the web-token/jwt-framework as JWT Creator/Loader.
The release process is described here.
This library needs at least:
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
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;
}
}
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:
composer require web-token/signature-pack
(not recommended)composer require web-token/jwt-signature-algorithm-hmac
composer require web-token/jwt-signature-algorithm-ecdsa
composer require web-token/jwt-signature-algorithm-eddsa
composer require web-token/jwt-signature-algorithm-none
(not recommended)composer require web-token/jwt-signature-algorithm-experimental
(not recommended)composer require web-token/encryption-pack
(not recommended)composer require web-token/jwt-encryption-algorithm-ecdh-es
composer require web-token/jwt-encryption-algorithm-aeskw
composer require web-token/jwt-encryption-algorithm-rsa
composer require web-token/jwt-encryption-algorithm-aesgcmkw
composer require web-token/jwt-encryption-algorithm-dir
(not recommended)composer require web-token/jwt-encryption-algorithm-pbes2
(not recommended)composer require web-token/jwt-encryption-algorithm-aesgcm
composer require web-token/jwt-encryption-algorithm-aescbc
composer require web-token/jwt-encryption-algorithm-experimental
(not recommended)This bundle needs to be configured. Please see this page to know how to configure it.
There is nothing to do. Just use your application as usual.
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 :beers: or more!
Or
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.
This project is release under MIT licence.