docs: private static Credential authorize() throws Exception {
      OAuth2ClientCredentials.errorIfNotSpecified();
      // set up authorization code flow
      AuthorizationCodeFlow flow = new AuthorizationCodeFlow.Builder(BearerToken
          .authorizationHeaderAccessMethod(),
          HTTP_TRANSPORT,
          JSON_FACTORY,
          new GenericUrl(TOKEN_SERVER_URL),
          new ClientParametersAuthentication(
              OAuth2ClientCredentials.API_KEY, OAuth2ClientCredentials.API_SECRET),
          OAuth2ClientCredentials.API_KEY,
          AUTHORIZATION_SERVER_URL).setScopes(Arrays.asList(SCOPE))
          .setDataStoreFactory(DATA_STORE_FACTORY).build();
      // authorize
      LocalServerReceiver receiver = new LocalServerReceiver.Builder().setHost(
          OAuth2ClientCredentials.DOMAIN).setPort(OAuth2ClientCredentials.PORT).build();
      return new AuthorizationCodeInstalledApp(flow, receiver).authorize("user");
    }