public AuthConfig createAuthConfig(boolean isPush, boolean skipExtendedAuth, Map authConfig, Settings settings, String user, String registry)
            throws MojoExecutionException {

        AuthConfig ret = createStandardAuthConfig(isPush, authConfig, settings, user, registry);
        if (ret != null) {
            if (registry == null || skipExtendedAuth) {
                ret.setRegistry(registry);
                return ret;
            }
            try {
                ret= extendedAuthentication(ret, registry);
                ret.setRegistry(registry);
                return ret;
            } catch (IOException e) {
                throw new MojoExecutionException(e.getMessage(), e);
            }
        }

        // Finally check ~/.docker/config.json
        ret = getAuthConfigFromDockerConfig(log, registry);
        if (ret != null) {
            ret.setRegistry(registry);
            log.debug("AuthConfig: credentials from ~/.docker/config.json");
            return ret;
        }

        log.debug("AuthConfig: no credentials found");
        return null;
    }
Create an authentication config object which can be used for communication with a Docker registry

The authentication information is looked up at various places (in this order):

<ul>
   <li>From system properties</li>
   <li>From the provided map which can contain key-value pairs</li>
   <li>From the openshift settings in ~/.config/kube</li>
   <li>From the Maven settings stored typically in ~/.m2/settings.xml</li>
   <li>From the Docker settings stored in ~/.docker/config.json</li>
</ul>

The following properties (prefix with 'docker.') and config key are evaluated:

<ul>
    <li>username: User to authenticate</li>
    <li>password: Password to authenticate. Can be encrypted</li>
    <li>email: Optional EMail address which is send to the registry, too</li>
</ul>

 If the repository is in an aws ecr registry and skipExtendedAuth is not true, if found
 credentials are not from docker settings, they will be interpreted as iam credentials
 and exchanged for ecr credentials.

@param isPush if true this AuthConfig is created for a push, if false it's for a pull
@param skipExtendedAuth if true, do not execute extended authentication methods
@param authConfig String-String Map holding configuration info from the plugin's configuration. Can be <code>null</code> in
                  which case the settings are consulted.
@param settings the global Maven settings object
@param user user to check for
@param registry registry to use, might be null in which case a default registry is checked,
@return the authentication configuration or <code>null</code> if none could be found

@throws MojoFailureException
src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java