pwmckenna / generator-travis-ci

Yeoman generator for travis-ci setup [available for Yeoman >= 1.0 beta]
http://npmjs.org/package/generator-travis-ci
31 stars 4 forks source link

Two-factor authentication #8

Open josephspens opened 10 years ago

josephspens commented 10 years ago

I keep failing to pass authorization during the setup process, I believe it's because I have two-factor authentication enabled on my account. Does this generator take that into account, and/or is there a way around it?

pwmckenna commented 10 years ago

I'm not really sure...could you describe how you set up your two factor auth so I can take a crack at reproducing the issue?

josephspens commented 10 years ago

I followed Github's tutorial when setting up two-factor auth, and found an article describing extra steps needed for two-factor auth.

Hope this helps.

pwmckenna commented 10 years ago

I'll give it a go this evening, and let you know what I find. Worst case scenario, I can walk you through getting your repo set up manually...speaking of which, I should write a blog post describing exactly which steps the generator takes.

josephspens commented 10 years ago

Thank you so much, I've been working on this issue on and off for a couple months and got close a few times. I was going to copy your generator template for the travis .yml file and do it manually, I'll go through with that if two-factor auth turns out to be a bigger pain in the ass then expected.

pwmckenna commented 10 years ago

egads! don't hesitate to ask for help next time. months is much too long to go without glorious travis-ci-ing!

elldritch commented 10 years ago

+1. Generator dies on "Ensure Github Travis App Authorized" even though it's already been authorized and I click "Allow Access" every time it brings the prompt up.

pwmckenna commented 10 years ago

on it...turns our there were a couple changes that were breaking the existing functionality altogether...patched that up and released last night. this is the only thing left on my plate.

pwmckenna commented 10 years ago

looks like we're going to be in a holding pattern until this patch is merged into the github module. its already been reviewed, so shouldn't be too much longer. once that's done, it'll hopefully be a pretty easy fix to add support for the two factor auth stuff. thanks for the input!

pwmckenna commented 10 years ago

@The2ndOne3 @josephspens support for 2FA just landed in master...I've tested it a bunch and it looks good, but I wanted to give you guys a chance to try it out before publishing it if you'd like. Thanks! :beers:

elldritch commented 10 years ago

Still dies for me -- I'm prompted to authorise Travis, I accept, and then it takes me to the Travis website where I'm not logged in. Even after logging in on the site, the generator is still stalled at "Ensure Github Travis App Authorized".

pwmckenna commented 10 years ago

@The2ndOne3 good catch...didn't fully comprehend how much 2FA affected things. master should handle the travis app authorization step fine now. thanks so much for helping test!

josephspens commented 10 years ago

Hmm I'm still getting some errors

 (travis) ~/Development/josephspens.github.io 
joseph-> yo travis-ci

   ╔══════════════════════════════════╗
   ║¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤╔══════════════════════╗¤¤¤¤¤║
   ║¤¤¤¤¤║ ╔══════════════════╗ ║¤¤¤¤¤║
   ║¤¤¤¤¤║ ║ ╔═════╗  ╔═════╗ ║ ║¤¤¤¤¤║
   ║¤¤¤¤¤║ ╚═╝ ╔═╗ ║  ║ ╔═╗ ╚═╝ ║¤¤¤¤¤║
   ║¤¤¤¤¤╚═════╝¤║ ║  ║ ║¤╚═════╝¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤¤║ ║  ║ ║¤¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤¤║ ║  ║ ║¤¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤¤║ ║  ║ ║¤¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤¤║ ║  ║ ║¤¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤╔╝ ║  ║ ╚╗¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤║ ╔╝  ╚╗ ║¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤║ ╚════╝ ║¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤╚════════╝¤¤¤¤¤¤¤¤¤¤¤¤║
   ║¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤║
   ╚══════════════════════════════════╝

[?] What would you like Travis to do for you? travis-ci:gh-pages   (runs `grunt` on Travis-CI and deploys the build to your GitHub Pages branch)
   invoke   travis-ci:gh-pages
√ get repository owner
√ get project name
[?] User & Organization pages build into the master branch. Which branch would you like to develop in? source
√ get source branch
√ get build output branch
[?] GitHub Username: josephspens
[?] GitHub Password: **************
[?] GitHub 2FA One Time Password: 702329
✗ generate github oauth token - {"message":"Bad credentials","documentation_url":"http://developer.github.com/v3"}
✗ get user email - {"message":"Bad credentials","documentation_url":"http://developer.github.com/v3"}
pwmckenna commented 10 years ago

I sadly can't get this to repo...are you using sms 2FA? I've played around with failed auth a bit and it would seem that the one time password isn't even sent if the password isn't correct, so the fact that you got the code means your credentials were inputed fine...which leaves me with no good theory as to why this is happening.

josephspens commented 10 years ago

I'm using Google Authenticator, it's an app which generates keys for 2FA apps, not SMS.

aawc commented 10 years ago

+1 Exactly what @josephspens is facing. I'm also using the Android authenticator app.