private PortabilityJob setInitialAuthDataOnJob(SecretKey sessionKey, PortabilityJob job,
      AuthFlowConfiguration exportConfiguration, AuthFlowConfiguration importConfiguration)
      throws JsonProcessingException {
    // If present, store initial auth data for export services, e.g. used for oauth1
    if (exportConfiguration.getInitialAuthData() != null) {
      // Ensure initial auth data for export has not already been set
      Preconditions.checkState(
          Strings.isNullOrEmpty(job.jobAuthorization().encryptedInitialExportAuthData()));

      // Serialize and encrypt the initial auth data
      String serialized =
          objectMapper.writeValueAsString(exportConfiguration.getInitialAuthData());
      String encryptedInitialAuthData = encrypterFactory.create(sessionKey).encrypt(serialized);

      // Add the serialized and encrypted initial auth data to the job authorization
      JobAuthorization updatedJobAuthorization =
          job.jobAuthorization()
              .toBuilder()
              .setEncryptedInitialExportAuthData(encryptedInitialAuthData)
              .build();

      // Persist the updated PortabilityJob with the updated JobAuthorization
      job = job.toBuilder().setAndValidateJobAuthorization(updatedJobAuthorization).build();
    }
    if (importConfiguration.getInitialAuthData() != null) {
      // Ensure initial auth data for import has not already been set
      Preconditions.checkState(
          Strings.isNullOrEmpty(job.jobAuthorization().encryptedInitialImportAuthData()));

      // Serialize and encrypt the initial auth data
      String serialized =
          objectMapper.writeValueAsString(importConfiguration.getInitialAuthData());
      String encryptedInitialAuthData = encrypterFactory.create(sessionKey).encrypt(serialized);

      // Add the serialized and encrypted initial auth data to the job authorization
      JobAuthorization updatedJobAuthorization =
          job.jobAuthorization()
              .toBuilder()
              .setEncryptedInitialImportAuthData(encryptedInitialAuthData)
              .build();

      // Persist the updated PortabilityJob with the updated JobAuthorization
      job = job.toBuilder().setAndValidateJobAuthorization(updatedJobAuthorization).build();
    }
    return job;
  }
Creates a transfer job and prepares it for both the export and import service authentication
flow.
portability-api/src/main/java/org/datatransferproject/api/action/transfer/CreateTransferJobAction.java