travis-ci / travis.rb

Travis CI Client (CLI and Ruby library)
MIT License
1.59k stars 407 forks source link

When 2FA is enabled, `sshkey --generate` always prompts for security code, but does not trigger authentication workflow #413

Open BanzaiMan opened 8 years ago

BanzaiMan commented 8 years ago

With a 2FA-enabled GitHub account, sshkey --generate command always asks for authentication, even right after login.

In addition, it never initiates the 2FA authentication workflow, so we never get to run it.

$ travis sshkey --generate --debug
** Loading "/Users/asari/.travis/config.yml"
** Timeout::Error: execution expired
** Loading gh
** GET "config"
**   took 0.057 seconds
** GitHub API: HEAD /repos/travis-pro/test-project
** GET "repos/travis-pro/test-project"
**   took 0.31 seconds
** GET "config"
**   took 0.058 seconds
We need the GitHub login for the account you want to add the key to.
This information will not be sent to Travis CI, only to api.github.com.
The password will not be displayed.

Username: BanzaiMan
Password for BanzaiMan: **************
** GitHub API: GET /user?per_page=100
Two-factor authentication code for BanzaiMan:
davemachado commented 8 years ago

While researching why travis setup releases will not work, I stumbled across a lot of reference to how GitHub 2FA Authentication API will not play nice with Travis. Seems like a pretty big roadblock as of now.