Skip to content

Instantly share code, notes, and snippets.

@murraco
Created November 11, 2017 16:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save murraco/5dae435e69e0a4265a060d7a96d7be55 to your computer and use it in GitHub Desktop.
String token = jwtTokenProvider.resolveToken((HttpServletRequest) req);
if (token != null && jwtTokenProvider.validateToken(token)) {
Authentication auth = jwtTokenProvider.getAuthentication(token);
SecurityContextHolder.getContext().setAuthentication(auth);
}
filterChain.doFilter(req, res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment