---
title: "Comment by Saurabh Singh on \"Spring Boot REST API authentication best practices using JWT\" | Hashnode"
description: "Thanks for the detailed blog I learned a lot. I have only 1 doubt in our JWTFilter implementation. usernamePasswordAuthenticationToken .setDetails( new WebAuthe"
url: "https://hashnode.com/posts/spring-boot-rest-api-authentication-best-practices-using-jwt/61e44ef89f8415199ccaddff/comment/6323759e55fb028b6442a702"
---

[Discussion](https://hashnode.com/posts/spring-boot-rest-api-authentication-best-practices-using-jwt/61e44ef89f8415199ccaddff)

Comment [Spring Boot REST API authentication best practices using JWT](https://hashnode.com/posts/spring-boot-rest-api-authentication-best-practices-using-jwt/61e44ef89f8415199ccaddff)

[Saurabh Singh](https://hashnode.com/@saurabhsingh241)

[Sep 15, 2022](https://hashnode.com/posts/spring-boot-rest-api-authentication-best-practices-using-jwt/61e44ef89f8415199ccaddff/comment/6323759e55fb028b6442a702)

Thanks for the detailed blog I learned a lot. I have only 1 doubt in our JWTFilter implementation.

```
usernamePasswordAuthenticationToken
    .setDetails(new WebAuthenticationDetailsSource()
    .buildDetails(request));

SecurityContextHolder
    .getContext()
    .setAuthentication(usernamePasswordAuthenticationToken);
```

I am not able to understand what these two lines are doing can you explain.
