mattn / vim-gist

Vim plugin for Gist
http://www.vim.org/scripts/script.php?script_id=2423
1.69k stars 131 forks source link

gist-vim does not work with API keys #164

Open big-samantha opened 10 years ago

big-samantha commented 10 years ago

Hi there. I have two factor auth enabled and so cannot use my password for gist-vim auth.

Typically the solution is to use an API token, but putting in a token just results in "not found".

https://www.dropbox.com/s/arkg2nj4otrn7s0/Screenshot%202014-08-02%2015.42.24.png

Might be useful to implement. Thanks for the good work!

mattn commented 10 years ago

If you want to use two factor's auth, once rename ~/.gist-vim to ~/.gist-vim.old . And try :Gist -l, then you will give SMS message with code.

rianrainey commented 10 years ago

I also have two-factor auth and can't get gist-vim to work.

I have tried the following with no success:

When I type :Gist from within Vim, I get a prompt: Github password for rianrainey:. I type in my correct password, a SMS message appears on my phone, but Vim says 'Cancelled' in the status bar and I never get a chance to complete step 2 of the authentication.

What am I doing wrong?

mattn commented 10 years ago

Gist-vim can create ~/.gist automanically for two-factor auth.

When github returns non-OTP header, Canceled is displayed.

rra3 commented 9 years ago

I had a related problem with two-factor auth - I had set the personal access token in ~/.gist-vim but was confused to find that gist-vim seemed to not use it and continued to offer the OTP token error. I then noticed that the function s:GistGetAuthHeader returns before ~/.gist-vim is even read if a password is set in .gitconfig. Set g:gist_use_password_in_gitconfig = 0 to avoid the early return and allow the function to parse ~/.gist-vim for the personal service token in the case of two-factor auth.