szerhusenBC/jwt-spring-security-demo

SecurityContextHolder setAuthentication is unused?

gafarma89 opened this issue · 0 comments

Hi

first thank for your sharing...

I would like to ask why we need this:

SecurityContextHolder.getContext().setAuthentication(authentication);

source:

https://github.com/szerhusenBC/jwt-spring-security-demo/blob/master/src/main/java/org/zerhusen/security/rest/AuthenticationRestController.java#L44

@PostMapping("/authenticate") method returns only header from controller. Is there any reason of above line? If not, can we remove it?

Thank you