public void configureBasicAuth() {
    Preconditions.checkNotNull(credential);
    Preconditions.checkState(!credential.isOAuth2RefreshToken());

    authorization.set(
        Authorization.fromBasicCredentials(credential.getUsername(), credential.getPassword()));

    String registry = registryEndpointRequestProperties.getServerUrl();
    String repository = registryEndpointRequestProperties.getImageName();
    eventHandlers.dispatch(
        LogEvent.debug("configured basic auth for " + registry + "/" + repository));
  }
Configure basic authentication on this registry client.
jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java