Why do we need to load user details from the DB for each request in JWT authentication with Spring Security?
I am currently implementing JWT authentication in a Spring Boot application. In most tutorials and examples, I see that the UserDetailsService.loadUserByUsername method is called for each request to validate the token. Here is a snippet of my filter:
Authentication error using JWT token in Spring Security
I have a problem with using JWT tokens in Spring Security. I have configured a Spring configuration file using a JWT filter in it. But the difficulty arises in that I can only register a user and receive a token from him, with which I can then make other requests. But if I don’t create a user, but just want to authenticate via login/password to get a token, then I’m getting weird errors in POSTMAN
Configuration file: