heroku / heroku-accounts

Helps use multiple accounts on Heroku.
ISC License
549 stars 37 forks source link

Switching accounts requires repeat login when using 2FA #13

Open rdlugosz opened 6 years ago

rdlugosz commented 6 years ago

When switching accounts (via heroku accounts:set foo), if the user has 2-factor authentication in use they will get a Invalid credentials provided message when they next issue a heroku command.

After entering email, password and the current 2FA code the user is able to use heroku as expected.

Note that the set command appears to execute successfully. The error doesn't happen until you try to run any other Heroku command.

mobilutz commented 5 years ago

I think the big "problem" here is, that account:add only adds a username & password. But of course a 2FA accounts needs to validate these informations again and it looks like this validation is not saved by heroku-accounts.

jughead commented 5 years ago

It looks like it now always requires the browser login even if 2FA is disabled: https://devcenter.heroku.com/changelog-items/1530?utm_source=dlvr.it&utm_medium=twitter

alistairholt commented 5 years ago

This is such a painful thing to deal with. I have to do a browser login every time I switch accounts and of course, the browser is guaranteed to already be logged into an account that isn't the one you are trying to authorise and the Heroku auth flow kind of sucks.

kennethjiang commented 5 years ago

The flow to change account has been broken since I upgraded Heroku cli to the version that uses browser to login. Really annoying and painful. Please get it fixed!

JosephHalter commented 4 years ago

+1