How to fix the «Authentication failed for code.dmitry-fedyuk.com» failure for a composer command?

[RuntimeException]
Failed to execute git clone --no-checkout ‘https://yoursite.com:<password>@code.dmitry-fedyuk.com/m2e/stripe.git’ ‘/var/www/public/vendor/mage2pro/stripe’ --dissociate --reference ‘/root/.composer/cache/vcs/https—code.dmitry-fedyuk.com-m2e-stripe.git/’ && cd ‘/var/www/public/vendor/mage2pro/stripe’ && git remote add composer ‘https://yoursite.com:<password>@code.dmitry-fedyuk.com/m2e/stripe.git’ && git fetch composer
Cloning into ‘/var/www/public/vendor/mage2pro/stripe’…
fatal: Authentication failed for ‘https://yoursite.com:@code.dmitry-fedyuk.com/m2e/stripe.git/’

Mage2.PRO code repository supports 2 authentication methods:

  1. By a login and password.
  • By an SSH key.

How to diagnose the «Authentication failed» error

1. Authentication by a login and password

It is a legacy authentication method, but it is supported and will supported foreever.
You can check whether you use this method by checking the Composer’s auth.json file.
If you have this file, and the file has an entry for code.dmitry-fedyuk.com with login and password, then you do use the
login / password authentication.
In this case you should ensure that login and password in the auth.json file are correct by trying to use them on the https://code.dmitry-fedyuk.com/users/sign_in webpage:

2. Authentication by an SSH key

It is a modern and the recommended method.
If your site does not use the method 1 (login / password authentication), then it surely uses the method 2 (SSH key authentication).
You should recheck the Step 4 of the installation instruction.

See also: