code: public String generateTemporaryToken(String key, int secondsToLive, Object context) {
      checkNotNull(key);
      String token = tokenGenerator.generate();
      tokenCache.put(key, Triplet.of(token, DateTime.now().plusSeconds(secondsToLive).getMillis(), context));
      return token;
    }
docs: Same as above but will also store a context that can be retried later.