lexik / LexikJWTAuthenticationBundle

JWT authentication for your Symfony API
MIT License
2.52k stars 611 forks source link

Multiple JWT authenticators #1206

Open ramard opened 7 months ago

ramard commented 7 months ago

Hi,

I'm in the process of upgrading to symfony 5.3 and therefore no longer use the guard component. I have a problem that I can't solve, which is the case of multiple JWT authenticators. This is what I had in my configuration:

api:
            pattern: ^/api/v1
            stateless: true
            anonymous: ~
            provider: api
            user_checker: App\Security\UserChecker\EnabledUserChecker
            entry_point: app.jwt_cas_authenticator
            guard:
                authenticators:
                    - app.jwt_cas_authenticator
                    - app.jwt_local_authenticator

Here the two authenticators are services that inherit from the "lexik_jwt_authentication.jwt_token_authenticator" service.

If I follow the documentation (https://github.com/lexik/LexikJWTAuthenticationBundle/blob/2.x/Resources/doc/6-extending-jwt-authenticator.rst), it seems that it is no longer possible to specify several authenticators.

Is there any other way around this?

Thank you in advance for your answers.