This seems like the wrong place for this, but Fin sent me, so here goes…
The example Java code shown in Intercom when going through the process to set up JWTs with Messenger does not specify the encoding. So if your JVM uses something other than UTF-8, the generated JWT will be invalid.
I suggest it should be updated, to call the `.getBytes(StandardCharsets.UTF_8) method on the string to ensure the encoding is always properly handled.
Map<String, Object> claims = new HashMap<>();
claims.put("user_id", userId.toString());
claims.put("email", email);
String token = Jwts.builder()
.setClaims(claims)
.setExpiration(Date.from(Instant.now().plus(24, ChronoUnit.HOURS))) // Expires in 24 hours
.signWith(SignatureAlgorithm.HS256, "<YOUR TOKEN HERE>".getBytes(StandardCharsets.UTF_8)) // Set proper encoding
.compact();