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
First, congrats on 2.0! I'm looking forward to checkout out all the changes!
On KnpU, since we use this bundle, I just had one user mention a small change in 2.0 that I think we can make smoother. Specifically, we use autowiring on a service that has JWTEncoderInterface as an argument. With 2.0, this gives the following exception:
Unable to autowire argument of type "Lexik\Bundle\JWTAuthenticationBundle\Encoder\JWTEncoderInterface" for the service "app.security.jwt_token_authenticator". Multiple services exist for this interface (lexik_jwt_authentication.encoder.default, lexik_jwt_authentication.encoder.lcobucci).
Could we mark the lexik_jwt_authentication.encoder.default as the correct autowiring service for this interface? We would just need an autowiring_types key added to that service (http://symfony.com/doc/current/components/dependency_injection/autowiring.html) - this is done in other places, like MonologBundle to mark @logger as the default LoggerInterface service.
Thanks!
The text was updated successfully, but these errors were encountered:
@weaverryan Really, thank you very much for the help you given on this major version.
I'm glad to see you upgrading and I hope it will not be too much work.
About the autowiring types, it's indeed something good to have that I totally missed 👍
As you spotted the change has been made. I just tagged a v2.0.1 so you should be able to get it.
I have to remind you that this bundle now has a built-in Guard authenticator, greatly inspired from the one of your KnpUniversity lesson and presentation (I'm pretty sure it is the very same that the DIC was not able to autowire :))
Feedbacks from you and your collaborators will be greatly appreciated.
Wow, that was so fast! And I already replied to the user (who just posted the comment this morning!). You rock :).
I have an issue internally to pull down 2.0.1 with our tutorial and make sure things are smooth - that'll be my chance to really test out the new version. I'm also excited to look at the authenticator - I will probably at least add a note so that users know that this is an option (versus building their own, which is a nice exercise, but not necessarily the best actual solution).
Cheers!
gzim324
pushed a commit
to gzim324/LexikJWTAuthenticationBundle
that referenced
this issue
Jan 10, 2025
First, congrats on 2.0! I'm looking forward to checkout out all the changes!
On KnpU, since we use this bundle, I just had one user mention a small change in 2.0 that I think we can make smoother. Specifically, we use autowiring on a service that has
JWTEncoderInterface
as an argument. With 2.0, this gives the following exception:Could we mark the
lexik_jwt_authentication.encoder.default
as the correct autowiring service for this interface? We would just need anautowiring_types
key added to that service (http://symfony.com/doc/current/components/dependency_injection/autowiring.html) - this is done in other places, like MonologBundle to mark@logger
as the defaultLoggerInterface
service.Thanks!
The text was updated successfully, but these errors were encountered: