Open utterances-bot opened 8 months ago
This is a very detailed tutorial, but I have a question. Can Dependency Injection (DI) be used within a JWT filter? I see some cases where it could be useful, such as checking the validity of a JWT token against another data source. Thank you in advance for your help.
This is a very detailed tutorial, but I have a question. Can Dependency Injection (DI) be used within a JWT filter? I see some cases where it could be useful, such as checking the validity of a JWT token against another data source. Thank you in advance for your help.
Yes, in case you still want to declare the filter as a Spring Bean, you can tell Spring Boot to not register it with the container by declaring a FilterRegistrationBean
bean and setting its enabled property to false
. For example:
Spring Security: Authentication using JWT
Spring Security: Authentication using JWT
https://whowrotethisshit.vercel.app/spring-security-authentication-using-jwt