8 thoughts to “Spring Boot 2 JWT Authentication with Spring Security”

  1. The clarity in your post is merely cool and I could assume you are an expert on this subject matter.
    Thanks a lot a million!

  2. Your posts are constructed clearly and have complex explanation, JWT based security is now easy for me, thanks!

  3. It’s difficult to find experienced people for this Spring Boot Security topic, but you give me good explanation! Thanks!

  4. Hello! I liked a lot of your content. Can you say what is common when we use REST requisitions with tokens for confirming a user? When we use it, we always do a new query to the database to confirm the user. Is it the most common? I am really confused by this detail. This seems to consume a lot of resources. I believe that with your experience you can help us. Thank you excellent post skin

    // extract user information
    String username = tokenProvider.getUserNameFromJwtToken(jwt);
    UserDetails userDetails = userDetailsService.loadUserByUsername(username);

    // create AuthenticationToken
    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
    authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));

Leave a Reply

Your email address will not be published. Required fields are marked *