HttpPost createSignedRequest(AuthConfig localCredentials, Date time) {
        String host = "api.ecr." + region + ".amazonaws.com";

        logger.debug("Get ECR AuthorizationToken from %s", host);

        HttpPost request = new HttpPost("https://" + host + '/');
        request.setHeader("host", host);
        request.setHeader("Content-Type", "application/x-amz-json-1.1");
        request.setHeader("X-Amz-Target", "AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken");
        request.setEntity(new StringEntity("{\"registryIds\":[\""+ accountId + "\"]}", StandardCharsets.UTF_8));

        AwsSigner4 signer = new AwsSigner4(region, "ecr");
        signer.sign(request, localCredentials, time);
        return request;
    }
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