code:   private String[] getParts(String encodedJWT) {
      String[] parts = encodedJWT.split("\\.");
      // Secured JWT XXXXX.YYYYY.ZZZZZ, Unsecured JWT XXXXX.YYYYY.
      if (parts.length == 3 || (parts.length == 2 && encodedJWT.endsWith("."))) {
        return parts;
      }
  
      throw new InvalidJWTException("The encoded JWT is not properly formatted. Expected a three part dot separated string.");
    }
  