Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GitHub two-factor authentication #2280

Closed
hkdobrev opened this issue Sep 20, 2013 · 5 comments
Closed

Support for GitHub two-factor authentication #2280

hkdobrev opened this issue Sep 20, 2013 · 5 comments
Labels
Milestone

Comments

@hkdobrev
Copy link
Contributor

Sometimes when composer fetches data from GitHub it needs your credentials to go over the API rate limit.

It will ask for your username and password and it says it exchanges them for an OAuth token.

But when the user has enabled two-factor authentication on their account this workflow no longer works. The password is not enough to obtain a token anymore. There are some basic explanations here: https://help.github.com/articles/providing-your-2fa-security-code#through-the-command-line

IMHO it should always ask directly for a token which the user should generate manually on github.com (instead of trusting composer it would not use the password for malicious purposes).

@Seldaek
Copy link
Member

Seldaek commented Sep 20, 2013

Yes now that it's easily possible to create tokens on the site, it would indeed make more sense than asking for passwords.

@hkdobrev
Copy link
Contributor Author

Just to elaborate more on this issue.

I was able to make the API request work when I disabled my 2FA, gave my password and then enabled it again.

Also when I wasn't able to make composer ask for my token directly, I have tried to write it directly in ~/.composer/config.json, but I couldn't guess the format easily.

@nicbaz
Copy link

nicbaz commented Oct 2, 2013

Ran into this problem today, as a temporary workaround you can manually update ~/.composer/config.json :

{
    "config": {
        "github-oauth": {
            "github.com": "<your access token here>"
        }
    }
}

@killua99
Copy link

killua99 commented Dec 5, 2013

Guys something new about this? ...

@Seldaek
Copy link
Member

Seldaek commented Mar 23, 2014

This has been fixed a month ago.

@Seldaek Seldaek closed this as completed Mar 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants