You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is how I am generating a JWT token in my symfony application:
`public function createAccessToken(string $username, array $payload = []): array
{
$user = JWTUser::createFromPayload($username, $payload);
and it all worked fine, until I have the need to generate a JWT token with dynamic configurations. Is it possible to achieve this somehow, I could not find anything in the documentation. I want to be able to pass the secret_ket and public_key + pass_phase in runtime ?
Ideas and workarounds are welcome :)
The text was updated successfully, but these errors were encountered:
Why your client side does not just parse the exp claim for your expiration date ? A JWT payload is just a JSON string in a base64url format. Moreover, you can customize the data returned in the payload as described here and use the regular generation process.
Here is how I am generating a JWT token in my symfony application:
`public function createAccessToken(string $username, array $payload = []): array
{
$user = JWTUser::createFromPayload($username, $payload);
I have set the configuration
lexik_jwt_authentication: secret_key: '%kernel.project_dir%/config/jwt/private.pem' public_key: '%kernel.project_dir%/config/jwt/public.pem' pass_phrase: '%env(JWT_PASSPHRASE)%' token_ttl: '%env(JWT_TTL)%'
and it all worked fine, until I have the need to generate a JWT token with dynamic configurations. Is it possible to achieve this somehow, I could not find anything in the documentation. I want to be able to pass the secret_ket and public_key + pass_phase in runtime ?
Ideas and workarounds are welcome :)
The text was updated successfully, but these errors were encountered: