Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2FA not working #35

Open
sobrinho opened this issue Feb 14, 2021 · 14 comments
Open

2FA not working #35

sobrinho opened this issue Feb 14, 2021 · 14 comments

Comments

@sobrinho
Copy link

$ heroku accounts:add personal
Enter your Heroku credentials:
Email: [redacted]
Password: [redacted]
 ▸    Multi-Factor Authentication is required for your account. Please remove the '--interactive' parameter and try again to login and complete MFA verification using a web
 ▸    browser.
@cvrsor
Copy link

cvrsor commented Mar 11, 2021

Any updates on this? Having the same issue

@rcrym
Copy link

rcrym commented Apr 15, 2021

Having this issue too. I'm getting a slightly different message though:

% heroku accounts:add personal
Enter your Heroku credentials:
Email: [redacted]
Password: [redacted]
 ▸    Your account has MFA enabled; API requests using basic authentication with email and password are not
 ▸    supported. Please generate an authorization token for API access.

@rubengmurray
Copy link

Same error message here

@abevoelker
Copy link

As a workaround, I did this to manually create an account (using Ubuntu):

$ mkdir -p ~/.heroku/accounts
$ echo "username: [email protected]\npassword: " > ~/.heroku/accounts/YOUR_ACCOUNT

Now when you try to execute a command with this account, Heroku recognizes the creds are bad and sends you to the browser login to get a token instead of asking for your password:

$ heroku accounts:set YOUR_ACCOUNT
$ heroku create
Creating app... !
 ▸    Invalid credentials provided.
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to [redacted]
Logging in... done
Logged in as [email protected]
Creating app... done,

@justindonnaruma
Copy link

This workaround doesn't allow you to switch easily. You have to sign in again each time.

I'm going to fork this project and submit a PR to support getting and setting the api token properly through the web auth flow.

@holtkamp
Copy link

#35 (comment)

Note that an API key can be used as password as well.

Source: https://stackoverflow.com/questions/68105084/not-able-login-to-heroku-account-from-command-line

@rubengmurray
Copy link

rubengmurray commented Dec 19, 2021

#38

@sobrinho
Copy link
Author

@rubengmurray doesn't work for actual personal accounts with 2FA.

@rubengmurray
Copy link

Really? I did the following:

  • heroku accounts:add my_name
  • prompted for email
  • prompted for password (used API key)

Worked.

I'm just using a standard personal login, go to top right, account settings, then bottom of the screen, API key...

@bruno-uy
Copy link

Using API key as password worked for me as well 😄 Thanks @holtkamp

@jrochkind
Copy link

jrochkind commented May 11, 2022

Needs instructions in the README for how to do this. I don't really follow the discussion in this thread.

Seeing as how heroku now requires MFA, and this tool does not work as documented with an account with MFA... I'm getting the feeling heroku doesn't actually support this tool anymore? (I'm getting the feeling it's unclear what heroku does support anymore?)

@rubengmurray
Copy link

@jrochkind - the fact I raised this in Dec last year and it's had 0 comments would support that theory, though I'm still using this fine with multiple accounts locally.

Is the generating of an API key to use as a substitute for your password the element that is unclear?

@divineslight
Copy link

The state of this repository is so bad that even it's from heorku, I feel insecure (Pun intended)

@dentarg
Copy link

dentarg commented Mar 12, 2024

@jrochkind I wrote a few words at #19 (comment) how I use this plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests