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?
The auth. json file stores encrypted authentication information for the user to container image registries. The file can have zero to many entries and is created by a login command from a container tool such as podman login , buildah login or skopeo login .
In this authentication storage method, an auth. json file will be present in the same folder as the projects' composer. json file. You can either create and edit this file using the command line or manually edit or create it.
You can place the auth. json file to the Magento 2 root directory, but I recommend place it to the COMPOSER_HOME directory for security reasons. You need the section only if you have installed Magento 2 from the [GitHub repository](https://github.com/magento/magento2).
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.
yes, pressing enter
works. For scripts you can set the environment variable GIT_ASKPASS=echo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With