vim-gist icon indicating copy to clipboard operation
vim-gist copied to clipboard

gist-vim does not work with API keys

Open big-samantha opened this issue 10 years ago • 4 comments

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!

big-samantha avatar Aug 02 '14 22:08 big-samantha

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.

mattn avatar Aug 03 '14 05:08 mattn

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

I have tried the following with no success:

  • manually creating a token and putting it in ~/.gist.vim
  • trying to let gist-vim create a token for me by typing in my password and SMS authentication code.

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?

rianrainey avatar Aug 26 '14 20:08 rianrainey

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

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

mattn avatar Aug 26 '14 23:08 mattn

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.

rra3 avatar Jun 21 '15 13:06 rra3