code: private static Result<Jwt> getCCTokenRemotely(final Jwt jwt) {
          TokenRequest tokenRequest = new ClientCredentialsRequest();
          //scopes at this point is may not be set yet when issuing a new token.
          setScope(tokenRequest, jwt);
          Result<TokenResponse> result = OauthHelper.getTokenResult(tokenRequest);
          if(result.isSuccess()) {
              TokenResponse tokenResponse = result.getResult();
              jwt.setJwt(tokenResponse.getAccessToken());
              // the expiresIn is seconds and it is converted to millisecond in the future.
              jwt.setExpire(System.currentTimeMillis() + tokenResponse.getExpiresIn() * 1000);
              logger.info("Get client credentials token {} with expire_in {} seconds", jwt, tokenResponse.getExpiresIn());
              //set the scope for future usage.
              jwt.setScopes(tokenResponse.getScope());
              return Success.of(jwt);
          } else {
              logger.info("Get client credentials token fail with status: {}", result.getError().toString());
              return Failure.of(result.getError());
          }
      }
docs: get Client Credential token from auth server
  @param jwt the jwt you want to renew
  @return Jwt when success, it will be the same object as the jwt you passed in; return Status when fail;