@Override
  public AuthData generateAuthData(
      String callbackBaseUrl, String authCode, String id, AuthData initialAuthData, String extra) {
    Preconditions.checkArgument(
        Strings.isNullOrEmpty(extra), "Extra data not expected for OAuth flow");
    Preconditions.checkArgument(
        initialAuthData != null, "Initial auth data expected for " + config.getServiceName());

    OAuthGetAccessToken accessTokenRequest = new OAuthGetAccessToken(config.getAccessTokenUrl());
    accessTokenRequest.transport = httpTransport;
    accessTokenRequest.temporaryToken = ((TokenSecretAuthData) initialAuthData).getToken();
    accessTokenRequest.consumerKey = clientId;
    accessTokenRequest.verifier = authCode;
    accessTokenRequest.signer =
        config.getAccessTokenSigner(
            clientSecret, ((TokenSecretAuthData) initialAuthData).getSecret());
    TokenSecretAuthData accessToken;
    try {
      OAuthCredentialsResponse response = accessTokenRequest.execute();
      accessToken = new TokenSecretAuthData(response.token, response.tokenSecret);
    } catch (IOException e) {
      monitor.severe(() -> "Error retrieving request token", e);
      return null;
    }

    return accessToken;
  }
General implementation of an {@link AuthDataGenerator} for OAuth1.
libraries/auth/src/main/java/org/datatransferproject/auth/OAuth1DataGenerator.java