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

Problems using manual token #106

Closed
sebbacon opened this issue Feb 6, 2020 · 1 comment
Closed

Problems using manual token #106

sebbacon opened this issue Feb 6, 2020 · 1 comment

Comments

@sebbacon
Copy link

sebbacon commented Feb 6, 2020

The token wizard is not working for me with 2FA (perhaps the same issue as #104). However, I'm also unable to get a manual token to work either.

When I run any command requiring a token, I can see the .authinfo.gpg is being parsed correctly, but it still falls back to the wizard.

Here is what auth-source is writing as debug messages. It seems like someting is looking up port 443 as a host, and the protocol https as a port?

auth-source-search: found 3 backends matching (:host "api.github.com" :user "sebbacon^forge" :max 1)
Decrypting /home/seb/.authinfo.gpg...done
auth-source-search-backend: got 1 (max 1) in netrc:~/.authinfo.gpg matching (:host "api.github.com" :user "sebbacon^forge" :max 1)
auth-source-search: found 1 results (max 1) matching (:host "api.github.com" :user "sebbacon^forge" :max 1)
auth-source-search: found 3 backends matching (:max 1 :host ":443" :port "https")
auth-source-netrc-parse: using CACHED file data for ~/.authinfo.gpg
auth-source-search: found 0 results (max 1) matching (:max 1 :host ":443" :port "https")
auth-source-search: found 3 backends matching (:max 1 :host ":443" :port "https")
auth-source-netrc-parse: using CACHED file data for ~/.authinfo.gpg
auth-source-netrc-parse: using CACHED file data for ~/.authinfo
auth-source-netrc-parse: using CACHED file data for ~/.netrc
auth-source-search: found 0 results (max 1) matching (:max 1 :host ":443" :port "https")
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"))
@tarsius
Copy link
Member

tarsius commented Mar 6, 2020

You might want to add a debug statement to ghub--auth-source-get. If that isn't called with invalid arguments, then the invalid values above must come from somewhere else. If on the other hand you can verify that ghub hands over invalid values, then you should look at where it gets that from until you have found the source of the problem.

Nobody else reported anything like this. I expect it is a misconfiguration on your end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants