PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 8, 2022

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

 February 08, 2022     composer-php, php     No comments   

Issue

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


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.



Answered By - Chase
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing