private static AuthConfig getAuthConfig()

in src/main/java/com/microsoft/jenkins/appservice/WebAppDeploymentRecorder.java [319:341]


    private static AuthConfig getAuthConfig(final String registryAddress, final DockerRegistryToken dockerRegistryToken)
            throws AzureCloudException {
        if (dockerRegistryToken == null) {
            throw new AzureCloudException("cannot find the docker registry credential.");
        }

        final AuthConfig authConfig = new AuthConfig();

        // formulated registry address
        String url = StringUtils.isBlank(registryAddress) ? AuthConfig.DEFAULT_SERVER_ADDRESS : registryAddress;
        if (!url.toLowerCase().matches("^\\w+://.*")) {
            url = "http://" + registryAddress;
        }
        authConfig.withRegistryAddress(url);

        // registry credential
        final String[] credentials = new String(Base64.decodeBase64(dockerRegistryToken.getToken()), Charsets.UTF_8)
                .split(":", 2);
        authConfig.withUsername(credentials[0]);
        authConfig.withPassword(credentials[1]);

        return authConfig;
    }