79371676

Date: 2025-01-20 14:50:00
Score: 1
Natty:
Report link

Yes, it is possible i'm adding this response as the spring-security-jwt mentionned in the accepted request is now deprecated :

Depend on the authentication method, generally we use Username/Password :

First : we need to expand the UsernamePasswordAuthenticationFilter, which is subtype of AbstractAuthenticationProcessingFilter, see the docs

Here we must override AbstractAuthenticationProcessingFilter.successfulAuthentication() method, you need this library for jwt algorithm & processing and add the jwt in the header of response

Second : we need to override the OncePerRequestFilter and process the token and authenticate the user with help of doFilterInternal method

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Younes Chakrani