When using composer with a private VCS it infinitely asks for authorization

composer-php, php

Solution

This is because the current version of composer `aa74818fe00c5f5eb57c1c38b807e9e2950c670c` does not support GitHubs 2 factor authorization. So any account that have that setup will have this issue.

There has been a pull request created for it and it should be good to go in one of the upcoming version updates.

Problem

In my composer.json i have a private vcs repository: ``` { "type": "vcs", "url": "https://github.com/username/repo.git" } ``` When i call `php composer.phar update` i get the following: ``` Your GitHub credentials are required to fetch private repository metadata (https://github.com/username/repo.git) The credentials will be swapped for an OAuth token stored in /root/.composer/config.json, your password will not be stored To revoke access to this token you can visit https://github.com/settings/applications Username: myusername Password: Authentication required (api.github.com): Username: myusername Password: Authentication required (api.github.com): Username: myusername Password: Authentication required (api.github.com): Username: ``` Doesnt matter how many time I put in my my github credentials it keeps asking. If i put in incorrect ones it does the same thing, no errors or max attempts. Any ideas what would cause this? I am using the latest version as retrievable by running: ``` php composer.phar self-update ``` WORK AROUND As a work around for now i have gone to: https://github.com/settings/applications and generated a token manually then ran: ``` php composer.phar config -g github-oauth.github.com <token> ``` But i would still like to know why it couldnt do it automatically

Original source