private JsonObject executeRequest(CloseableHttpClient client, HttpPost request) throws IOException, MojoExecutionException {
        try {
            CloseableHttpResponse response = client.execute(request);
            int statusCode = response.getStatusLine().getStatusCode();
            logger.debug("Response status %d", statusCode);
            if (statusCode != HttpStatus.SC_OK) {
                throw new MojoExecutionException("AWS authentication failure");
            }

            HttpEntity entity = response.getEntity();
            Reader jr = new InputStreamReader(entity.getContent(), StandardCharsets.UTF_8);
            return new Gson().fromJson(jr, JsonObject.class);
        }
        finally {
            client.close();
        }
    }
Perform extended authentication.  Use the provided credentials as IAM credentials and
get a temporary ECR token.

@param localCredentials IAM id/secret
@return ECR base64 encoded username:password
@throws IOException
@throws MojoExecutionException
src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java