Not able to log in to Heroku account from command line

9.2k Views Asked by At

I am using codio.com. From there I am using the Ubuntu terminal to log into Heroku but it's giving me the below error. I have read the help page also. It says with MFA you have to use browser for login. But the issue is, browser is not opening from Codio platform. I am stuck at this point. Please help.

codio@actor-spoon:~/workspace/helloSaas$ heroku login -i                 
heroku: Enter your login credentials
Email: [email protected]
Password: ********
 ›   Error: 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. 
 ›
 ›   Error ID: vaas_enrolled

Working :) : Just paste API key in place of password.

codio@magic-savage:~/workspace/rottenpotatoes$ heroku login -i
 ›   Warning: heroku update available from 7.45.0 to 7.59.2.
heroku: Enter your login credentials
Email: [email protected]
Password: ************************************
Logged in as [email protected]
codio@magic-savage:~/workspace/rottenpotatoes$ 
4

There are 4 best solutions below

1
On BEST ANSWER

you can use the "API Key" as the password. enter image description here

0
On

Disable two-factor authentication in your heroku account settings.

You can disable two-factor authentication from the Dashboard account page. You will be asked to supply your password for added security. You can also disable it from the CLI with the following command:

$ heroku 2fa:Disable

This will also ask for your password.

(From here.)

0
On

There is no way to disable MFA UI_PIC

Go here to browse account setting Scroll down and reveal / re-generate the API-KEY API_KEY

Then login in cli by

heroku login -i

type your email and use API Key as password, you are ready to go

0
On

Enter "heroku login -i" in an active virtual terminal session then enter your email.

Use a browser to access https://dashboard.heroku.com/account, scroll down to API Key, click on Reveal, copy the key and paste as your password. Hit enter and you should be logged in.