estou usando:
public String getSubject(String tokenJWT) {
try {
var algoritmo = Algorithm.HMAC256(secret);
return JWT.require(algoritmo)
.withIssuer("API Voll.med")
.build()
.verify(tokenJWT)
.getSubject();
} catch (JWTVerificationException exception) {
throw new RuntimeException("Token JWT inválido ou expirado!");
}
}
retorna este erro:
2023-01-18T09:35:59.243-03:00 ERROR 8420 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
java.lang.RuntimeException: Token JWT inválido ou expirado!
Caused by: java.lang.IllegalArgumentException: Illegal base64 character 20
aula: https://cursos.alura.com.br/course/spring-boot-aplique-boas-praticas-proteja-api-rest/task/117169