private static RegistryAuthenticationFailedException newRegistryAuthenticationFailedException(
      String registry, String repository, String authenticationMethod, String authParam) {
    return new RegistryAuthenticationFailedException(
        registry,
        repository,
        "'"
            + authParam
            + "' was not found in the 'WWW-Authenticate' header, tried to parse: "
            + authenticationMethod);
  }
Instantiates from parsing a {@code WWW-Authenticate} header.

@param authenticationMethod the {@code WWW-Authenticate} header value
@param registryEndpointRequestProperties the registry request properties
@param userAgent the {@code User-Agent} header value to use in later authentication calls
@param httpClient HTTP client
@return a new {@link RegistryAuthenticator} for authenticating with the registry service
@throws RegistryAuthenticationFailedException if authentication fails
@see <a
    href="https://docs.docker.com/registry/spec/auth/token/#how-to-authenticate">https://docs.docker.com/registry/spec/auth/token/#how-to-authenticate</a>
jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryAuthenticator.java