Is it possible to add a byte array in a JWT's body? I get a stream of bytes from a source and I want to package it into a JWT and send it off.
As a test, I tried converting a string to a byte array, added it to a jwt using the jjwt library, encoded it, decoded it, and the retrieved the bytes back. But they don't look the same.
String token = Jwts.builder().claim("key", "test".getBytes())
.signWith(<algorithm>, <signingkey>)
.compact();
Claims claims = Jwts.parser().setSigningKey(<signingkey>).parseClaimsJws(token).getBody();
byte[] ret = claims.get("key", String.class).getBytes();
But ret != "test".getBytes()