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

Prompted for 2FA code, yet get error "Must specify two-factor authentication OTP code" #104

Closed
Kazark opened this issue Jan 22, 2020 · 10 comments
Labels

Comments

@Kazark
Copy link

Kazark commented Jan 22, 2020

Thank you for your great work on the Magit ecosystem.

I am trying to get up and running with opening pull requests from within Spacemacs. My auth-sources is set to ("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"). Having entered my username, my GitHub password, and then the 2FA code---which I was not only prompted for, but received---I get the following error, and am unable to complete:

ghub--confirm-create-token: HTTP Error: 401, "Unauthorized", "/authorizations", ((message . "Must specify two-factor authentication OTP code.") (documentation_url . "https://developer.github.com/v3/auth#working-with-two-factor-authentication")) [2 times]

I tried this twice (thus with two separate 2FA codes) to make sure I did not enter the 2FA code incorrectly.

Let me know what else I can do to debug this issue or whatever other information I can provide.

@tarsius
Copy link
Member

tarsius commented Jan 22, 2020

I can reproduce the issue but it will likely be weeks until I can investigate this. So you should probably create the token manually, as documented in the manual.

@Kazark
Copy link
Author

Kazark commented Jan 23, 2020

@tarsius Thank you for your response. I will give the manual approach a shot.

@Kazark
Copy link
Author

Kazark commented Jan 23, 2020

@tarsius I did not have GPG set up either. I got that set up and used that to put an encrypted key in ~/.authinfo.gpg. It worked! And, I am absolutely blown away. I was looking for something simple and basic, but now I can actual browse PRs complete with discussion and emojis and everything mind blown. I did have to authorize an SSO organization myself, too; I don't know if the code would have done that for me (if the above had worked). Anyway, thanks again. I'll leave the issue open sine you said you can reproduce, but for my purposes, I am in the clear at this point.

@dalton-verkada
Copy link

dalton-verkada commented Jan 26, 2020

I also am experiencing this error setting up forge. Manually adding in '~/.authinfo' doesn't seem to fix it for me. From some debugging it looks like it's being picked up though.

auth-source-search: found 3 backends matching (:host "api.github.com" :user "dalton-verkada^forge" :max 1)
auth-source-search-backend: got 1 (max 1) in netrc:~/.authinfo matching (:host "api.github.com" :user "dalton-verkada^forge" :max 1)
auth-source-search: found 1 results (max 1) matching (:host "api.github.com" :user "dalton-verkada^forge" :max 1)

Hopefully this will help your investigation!

@tarsius
Copy link
Member

tarsius commented Feb 4, 2020

@Kazark Thanks 😁

@Blaisorblade
Copy link

FWIW same problem here, but manual token creation worked.

@achempion
Copy link

Was able to resolve it by adding a token to the ~/.authinfo

machine api.github.com login <login>^<package> password <token>

where <package> in my case was forge.

manual link

@pvinis
Copy link

pvinis commented Feb 18, 2020

I wouldn't say that you "resolved" it, more that you "worked around" it. I did the same. but it would be cool to have this working like before 😍

@tarsius
Copy link
Member

tarsius commented Apr 28, 2020

Github will stop supporting password authentication as whole in a few months. Because of that I don't plan to fix two-factor authentication--it would buy as a few months at best. Instead I intend to remove the wizard completely. For more information see #113.

@tarsius
Copy link
Member

tarsius commented Jul 3, 2020

Instead I intend to remove the wizard completely.

Done.

@tarsius tarsius closed this as completed Jul 3, 2020
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

6 participants