docs: public Credential authorize(String userId) throws IOException {
      try {
        Credential credential = flow.loadCredential(userId);
        if (credential != null
            && (credential.getRefreshToken() != null ||
                credential.getExpiresInSeconds() == null ||
                credential.getExpiresInSeconds() > 60)) {
          return credential;
        }
        // open in browser
        String redirectUri = receiver.getRedirectUri();
        AuthorizationCodeRequestUrl authorizationUrl =
            flow.newAuthorizationUrl().setRedirectUri(redirectUri);
        onAuthorization(authorizationUrl);
        // receive authorization code and exchange it for an access token
        String code = receiver.waitForCode();
        TokenResponse response = flow.newTokenRequest(code).setRedirectUri(redirectUri).execute();
        // store credential and return it
        return flow.createAndStoreCredential(response, userId);
      } finally {
        receiver.stop();
      }
    }