Created
February 16, 2018 00:41
-
-
Save anonymous/cc759b6e07cb82c072dc258a09c1135a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JWTAuthenticationFilter extends GenericFilterBean { | |
@Override | |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) | |
throws IOException, ServletException { | |
Authentication authentication = TokenAuthenticationService | |
.getAuthentication((HttpServletRequest) request); | |
SecurityContextHolder.getContext().setAuthentication(authentication); | |
filterChain.doFilter(request, response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment