Is a SecurityContext shared between requests when using Spring Security?
问题 I'm seeing some strange behaviour when using stateless token-based authentication on a rest API written using Spring Boot. The client includes a JWT token with each request, and a custom filter I've written that extends GenericFilterBean adds an Authentication object based on the claims in the token to the security context using the following : SecurityContextHolder.getContext().setAuthentication(authentication); And clears the context after processing the request by doing :