During composer update I am asked for my github credentials repeatedly. What may be causing this?
An existing OAuth token for Composer is present and will be reused
Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API >rate limit
The credentials will be swapped for an OAuth token stored in /Users/[USER]/.composer/auth.json, your >password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Yes, I am entering my password correct, I have tried several different accounts and I can get authorization from Github if I use curl from cmdline.
Possibly related to: https://developer.github.com/changes/2014-12-08-removing-authorizations-token/
Not really, solved it by creating new token and adding it to the project's composer.json. I'm not sure why the valid token on /Users/[USER]/.composer/auth.json could not be used.
I'm not sure why the valid token on /Users/[USER]/.composer/auth.json could not be used.
Maybe due to current user or COMPOSER_HOME environment variable at the time of the composer install being different of the expected?
I think I stumbled to something like that before.
solved it by creating new token and adding it to the project's composer.json
Could someone post the format of how to do this? I'm experiencing a similar problem and wish to solve it manually for the moment
Could someone post the format of how to do this? I'm experiencing a similar problem and wish to solve it manually for the moment
Yes, i want to know too
You can solve it by creating a new github token to authenticate your composer requests.
You can do this two ways:
By defining your token globally:
composer config --global github-oauth.github.com <TOKEN>
Or by defining your token in a project composer.json:
{
"config": {
"github-oauth": {
"github.com": "<TOKEN>"
}
}
}
More information about the problem and how to generate github tokens:
Composer troubleshooting
hugofonseca thanks a lot!
@hugofonseca Thanks!
The global Token config does not work (as mentiod in Post 3):
C:\Users\robin.kluth>composer diag
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri:
Could not fetch https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0, ent
er your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in C:/Users/robin.klut
h/AppData/Roaming/Composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applica
tions
Username:
while in %appdata%Composerauth.json:
{
"http-basic": {},
"github-oauth": {
"github.com": "my_token"}
}
If I add the token to projects composer.json, it is working as expected.
So the solution is to put the token into the composer.json directely instead of relying on the auth.json?
Will this be solved as suggested in the latest issue https://github.com/composer/composer/issues/3566 @Seldaek ?
Because as Malcolm Fell @emarref mentions:
If you're working on a collaborative project, you should not commit your key in the project source control. The alternative is to set your key in your home directory...
https://coderwall.com/p/kz4egw/composer-install-github-rate-limiting-work-around
Hi,
I figured out, that the auto-generated token (via composer) ist not accepted. If I create the key via GitHub's WebUI and replace the old one in composer.json, it is working.
Have you tried that within the auth.json or config.json too?
I generated new token on Gtihub and pasted this in ocmposer json of the project and it worked, thanks to hugofonseca
{
"config": {
"github-oauth": {
"github.com": "<TOKEN>"
}
}
}
Ok, so the important point is that the token has to be added to the `composer.json' file.
The attempt with auth.son of Composer is no longer supported by the curernt GitHub API:
https://github.com/composer/composer/issues/3566
It looks like @Seldaek added a fix for the original issue by @fiatux :
https://github.com/composer/composer/pull/3651
Gracias fonsecas72, funciona :D
composer clear-cache
composer global require "fxp/composer-asset-plugin:1.0.0-beta4"
composer config --global github-oauth.github.com "my_token"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
As铆 me funcion贸 para Yii2 Advanced Template.
Hi I was face same problem.
Solution for me was:
composer config --global github-oauth.github.com <TOKEN>
thanks @fonsecas72
...and as a result of it was writing token at auth.json :
{
"config": {
"github-oauth": {
"github.com": "<TOKEN>"
}
}
}
...but not in composer.json - that was just mistake in explanation, but if you run
composer config --global github-oauth.github.com <TOKEN>
Posted by codekman at
http://www.yiiframework.com/forum/index.php/topic/60340-issue-while-installing-yii-2/
Please see the line above the cmd, here you will find the url and visit this url and you will git the token and paste the token.
Is possible to remove auth token via composer config -g command? I mean something like composer config -g --unset repositories.foo but for auth.json.
Sure, I can remove by fe jg but build-in support in composer should be cool.
This will do it for example: composer config --global --auth --unset github-oauth.github.com
Can you guys make something which works without extensive modifications even for a beginner?
solved by use this cmd: composer config --global --auth github-oauth.github.com
for example : composer config --global --auth github-oauth.github.com 123456
solution :
just add in composer.json
"config": {
"process-timeout": 1800,
"fxp-asset": {
"enabled": false
}
},
If you are facing Github token error then open composer.json file and paste below code
"github-oauth": {
"github.com": "
}
into
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"github-oauth": {
"github.com": "
}
}
And then update composer
composer update
If you don't have Github token then first login to github.com and generate token and use ablove steps.
Most helpful comment
You can solve it by creating a new github token to authenticate your composer requests.
You can do this two ways:
By defining your token globally:
Or by defining your token in a project composer.json:
More information about the problem and how to generate github tokens:
Composer troubleshooting