-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Never sent 2FA code, though prompted for one. (magit-2.13.0, ghub 2.0.1) #65
Comments
I was able to work around this by manually generating a token and placing it in |
Do you mean "my device is never asked to send an one-time password"? I don't remember the details but
I'm glad. I don't plan to teach |
Thanks as always for your quick response, @tarsius.
No. GitHub is set up to send an OTP to my phone via SMS. I believe GitHub on a successful basic auth request should automatically send me an OTP and respond to the request with a https://developer.github.com/v3/auth/#working-with-two-factor-authentication Let me know if I'm missing something. If you're willing to point me in the right direction I can perhaps try to write a PR for this. Otherwise I can try to sort things out myself. |
As a quick test I just ran the following a few times:
And received an OTP on my phone each time. |
And the story gets even stranger. If I follow the procedure outlined in the OP, I continue to not receive OTP codes on my phone. If, OTOH, I run the following elisp, I get sent OTPs.
As near as I can tell that code must be getting called both times because in both paths I am prompted with the |
The problem comes from this call to Not sure what to do about it but that's why calling the |
I have confirmed that the following request does not generate an OTP.
I'm trying to look at the docs to see if that is expected it or not. |
Thanks for investigating. |
Fixes magit#65 We're facing a bit of a chicken and egg problem here. This function is called during the flow where we realize that we don't have an API token. Because we don't have an API token we want to generate one. We don't want to generate a new one if we already have one though, so we try to interact with the API to determine whether we have one, which we can't do because we don't have a token. I _think_ it would be better to not triggre the 2FA errorback function here by augmenting `ghub--get-token-id` to somehow ignore the 2FA error just for this flow. But I don't have a good instinct as to how that would fit with the rest of the library. So this commit is mainly for feedback.
I have a similar issue, but I'm not sure if it's related. I enter the code I received on my phone, and get an error. Here is the traceback:
|
@parhamdoustdar 2 questions:
|
Sure! No clue on the first question, I installed the package from Melpa.
What I did was to go to a repository I had cloned from Github, and press
"bY" to check out a pull request. I have no token set up, so when I was
prompted if I wanted the token to be created, I answered "yes". This issue
went away when I manually created the token, though.
On Tue, 25 Sep 2018 at 15:56, Tim Visher <notifications@github.com> wrote:
@parhamdoustdar 2 questions:
Are you running this branch rather than master?
Can you describe the steps exactly as you completed them from emacs
invocation through to that stack trace?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
When you say 'Melpa' is that 'Melpa Stable' or 'Melpa'? Regardless, you're not running this branch if you installed from Melpa given that Melpa only makes If you're feeling adventurous, you could check out this branch, open an emacs instance, and then run |
We're facing a bit of a chicken and egg problem here. This function is called during the flow where we realize that we don't have an API token. Because we don't have an API token we want to generate one. We don't want to generate a new one if we already have one though, so we try to interact with the API to determine whether we have one, which we can't do because we don't have a token. I think it would be better to not trigger the 2FA errorback function here by augmenting `ghub--get-token-id` to somehow ignore the 2FA error just for this flow. But I don't have a good instinct as to how that would fit with the rest of the library. Fixes magit#65.
From a status buffer over TRAMP I run:
b Y
I am prompted that I do not have a token for the necessary request and given a choice to generate one.
I see the prompt
Two-factor authentication code:
but my device is never sent an OTP.Anything I can do to help debug this? I use 2FA with
hub
just fine so I don't think it's something wrong with my device setup.The text was updated successfully, but these errors were encountered: