/**
     * Saves auth.json file
     *
     * @param string $username
     * @param string $password
     * @return bool
     * @throws \Exception
     */
    public function saveAuthJson($username, $password)
    {
        $authContent = [
            self::KEY_HTTPBASIC => [
                $this->getCredentialBaseUrl() => [
                    self::KEY_USERNAME => "$username",
                    self::KEY_PASSWORD => "$password"
                ]
            ]
        ];
        $json = new \Zend\View\Model\JsonModel($authContent);
        $json->setOption('prettyPrint', true);
        $jsonContent = $json->serialize();

        return $this->getDirectory()->writeFile(
            \Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME .
            DIRECTORY_SEPARATOR . $this->pathToAuthFile,
            $jsonContent
        );
    }