LexikJWTAuthenticationBundle icon indicating copy to clipboard operation
LexikJWTAuthenticationBundle copied to clipboard

Error 500 when trying to use new blocklist feature

Open Sicaa opened this issue 6 months ago • 0 comments

Hi,

Symfony version : 5.4.42 PHP version : 8.2.6 Lexik bundle version : 2.21.0

I want to implement token invalidation so I followed this related documentation: https://github.com/lexik/LexikJWTAuthenticationBundle/blob/2.x/Resources/doc/10-invalidate-token.rst

Problem encoutered: when I add the blocklist_token configuration, all endpoints are returning an HTTP 500 error.

2024-08-28_14-13

Here is my lexik_jwt_authentication.yaml:

lexik_jwt_authentication:
    secret_key: '%env(resolve:JWT_SECRET_KEY)%'
    public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
    pass_phrase: '%env(JWT_PASSPHRASE)%'
    token_ttl: 86400 # 1 day
    # invalidate the token on logout by storing it in the cache
    blocklist_token:
        enabled: true
        cache: cache.app

It seems that the problem is triggered by the service declaration (vendor\lexik\jwt-authentication-bundle\Resources\config\blocklist_token.xml):

2024-08-28_14-28

Any idea? Thanks!

Sicaa avatar Aug 28 '24 12:08 Sicaa