Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pushing to GitHub with Pycharm and Two Factor Authentication

Using Pycharm, I have configured it to connect to my GitHub account where I have two-factor authentication enabled. When I first open Pycharm, I have the option to pull down from GitHub, where it has be log in (or saves my credentials) but then prompts me for my authentication token, which works fine. It pulls down the repo just as it should. The problem stems when I try to commit and push files back up. I execute the commit, give it a description, then try to push the commit, and I login at this dialog:

Pycharm git login

The problem here is that it doesn't give me the opportunity to enter my two-factor authentication token for the push, and the authentication fails.

Is there any way to:

  1. Have Pycharm re-prompt for the token
  2. Cache the token from the initial login (less secure of course)
  3. Set up the equivalent of a "Google Application Password" where it has a separate tokenless password for just this one application (much less secure)

Or is this just a bug that needs reported? I have just started using Pycharm, but couldn't find much useful information on this subject.

like image 830
Tim S. Avatar asked Mar 19 '16 18:03

Tim S.


1 Answers

Thanks to jonrsharpe for pointing me in the right direction, here is what I did to resolve this:

In the Settings menu, under Version Control, there is a GitHub section. In here, there is an Auth Type dropdown, where you can select Password or Token. (See Image) Selecting token will prompt you for your authentication token, then create an API key that will bypass the need for a token directly during a push. This was exactly what I needed.

enter image description here

like image 184
Tim S. Avatar answered Sep 28 '22 12:09

Tim S.