private CachableUserInfo checkUserCache(String userId, String token) {
    if (cache == null) {
      return null;
    }

    return cache.getUserToken(userId, token);
  }
  private void cacheUserInfo(CachableUserInfo user) {
    if (user == null || cache == null) {
      return;
    }

    try {
      cache.storeToken(user.getTenantId(), user, user.tokenTtl().intValue());
    } catch (IOException ex) {
      LOG.warn(
          "Unable to cache user token information: "
              + user.getUserId()
              + " Reason: "
              + ex.getMessage(),
          ex);
    }
  }