Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityContextHolder setAuthentication is unused? #111

Open
gafarma89 opened this issue Jun 2, 2020 · 0 comments
Open

SecurityContextHolder setAuthentication is unused? #111

gafarma89 opened this issue Jun 2, 2020 · 0 comments

Comments

@gafarma89
Copy link

gafarma89 commented Jun 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant