7

Even though i have auth.json in my $COMPOSER_HOME and it's loaded, composer still requires me to type credentials on install/update.

This is the output of composer update -vvv that confirms that auth.json has been loaded

Reading ./composer.json
Loading config file /home/user/.config/composer/config.json
Loading config file /home/user/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html/api): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/user/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/html/api/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Running 1.6.3 (2018-01-31 16:28:17) with PHP 7.2.10-0ubuntu0.18.04.1 on Linux / 4.15.0-38-generic
Loading composer repositories with package information
Executing command (/home/user/.cache/composer/vcs/https---private.server.io-private-repo.git/): git rev-parse --git-dir
Executing command (/home/user/.cache/composer/vcs/https---private.server.io-private-repo.git/): git remote -v
Executing command (/home/user/.cache/composer/vcs/https---private.server.io-private-repo.git/): git remote set-url origin 'https://private.server.io/private/repo.git' && git remote update --prune origin
Username for 'https://private.server.io': 

This is my auth.json in /home/user/.config/composer/auth.json:

{
    "http-basic": {
        "private.server.io": {
            "username": "myUsername",
            "password": "myPassword"
        }
    }
}

I copied settings from my old computer where it worked but now it doesn't. I've deleted the auth.json and composer asked me if I want it to remember my credentials, which I said yes, but nothing worked. Any ideas how to get it working?

2 Answers 2

4

This is known behavior in Ubuntu18.04 if you use the same. But if you just hit enter each time it asks for username and password, it will pick them from auth.json and will complete the composer install/update.

0
1

yes, pressing enter works. For scripts you can set the environment variable GIT_ASKPASS=echo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.