class JwtAuthenticationProvider implements AuthenticationProvider {

    @Override
    public Authentication authenticate(Authentication authentication) {
        String email = Jwts.parser()
            .setSigningKey(jwtTool.getAccessTokenKey())
            .parseClaimsJws(authentication.getName())
            .getBody()
            .getSubject();
        @SuppressWarnings({"unchecked, rawtype"})
        List<String> authorities = (List<String>) Jwts.parser()
            .setSigningKey(jwtTool.getAccessTokenKey())
            .parseClaimsJws(authentication.getName())
            .getBody()
            .get(AUTHORITIES);
        return new UsernamePasswordAuthenticationToken(
            email,
            "",
            authorities.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList())
        );
    }

    public  JwtAuthenticationProvider(JwtTool jwtTool);

}